« first day (4530 days earlier)      last day (518 days later) » 

12:01 AM
gosh darn it
You really need to make sure your ead those descriptions
basically: 535

I assumed that would be a viewing distance of 1, but it's actually a viewing distance of 2.

The reason I made the incorrection assumption is that trees on an edge have a viewing distance of 0, so I didn't even bother reading the rest of the problem.
Basically I felt like in the example:

343
424
343

The middle tyree, of height 2, has a viewing distance of 0, nto 1... because there's no fucking view it's blocked
 
Yeah isn't it how many trees you can see in each direction
So the edge can see 0 in one direction
And the short guy here can see 1 in all directions
 
lo lfuck
again, I skimmed it.
that's why you gotta actually read the full description and the exampoles
 
Did they announce the release date for The Winds of Winter yet
 
 
1 hour later…
1:36 AM
2
Q: What happens if you score more than 99 points in volleyball?

StevoisiakSome stages in Here Comes Niko! have a volleyball minigame with a 2 digit score counter on the side. What happens if you get a score above 99?

 
 
1 hour later…
2:44 AM
so we are getting a Death Stranding 2 and the screenshots are as intriguing as the first one
does remind that i need to complete the first one
i get too distracted just making deliveries
 
 
2 hours later…
 
5 hours later…
10:30 AM
Today's was the first day where we're waiting seconds for the solution to run
Maybe I could have been more efficient though
 
Glad I'm catching my bugs in example inputs then
stupid diagonal movement
 
I came up with a super elagant solution for the physics
 
11:01 AM
For part 2, I just have an array of tails. Could probably put the head in the array as well.
 
 
1 hour later…
12:14 PM
THis guy really loves Plank Lengths
 
@Ronan I'm curious how you did it that takes seconds. Mine is basically instant and I didn't particularly optimize
 
@murgatroid99 Excellent
 
12:26 PM
@Wipqozn Yeah, I didn't even consider the possibility of a sequel until I saw that, but the first one was fantastic so I expect a lot from another one.
 
@murgatroid99 I also never thought it would happen. First one is so damn good though. First sequel super giant has ever done oto.
 
12:48 PM
Gonna be honest, I was expecting my PArt 1 to fail on some weird edge case I didn't consider.
now I gotta get ready for work before I do part 2
actually looks liek part 2 is really easy
so I'll try to knock it out
 
@murgatroid99 It's probably just a small inefficiency, I might optimise it at some point github.com/Nanor/advent_of_code/blob/main/2022/src/days/day9.ts
But it's a few seconds, so I'm not bothered
 
Having said that, naturally I have some weird bug due to a typo or something,s o work readying time
 
@Ronan Are you growing the rope at every step?
 
Yeah I'm dumb, I was adding the tail to the tail's path 10 times for each step
So calculating the number of spots it visited was 10 times slower than it should be
 
nvm lol
My weird bug was that I didn't notice the example input had changed.
So there was no bug at all.
 
1:02 PM
@murgatroid99 Yeah it's instant now
 
@Ronan I think it's actually growing through the entire thing, so you made it O(N^2)
 
@Ronan @murgatroid99 That makes sense now then. I was confused why @Ronan solution was so slow.
 
@murgatroid99 Where are you seeing that? Path isn't the rope it's the history of where the tail has been
 
Thought maybe you did something silly like make a giant fucking array... but nope, just annoying bugs, ha
 
@Ronan Oh, you're right, I misread that
 
1:04 PM
A bug that doesn't affect the answers at all
 
@Ronan Which just makes it all the funnier that we bothered to figure out what was going on
We're quite the set of nerds here
 
It's called professionalism
 
Damn straight
I'm really getting a lot of mileage out of Sets this year
 
@Ronan It might just be that your path scan at the end is O(N^2)
 
@murgatroid99 Actually yeah I don't know what the implementation of findIndex is, it's definitely not the best way of doing it, some kind of hash of positions would be better
 
1:08 PM
@Ronan I used a Set
 
Ah you're turning the positions into a string to add them to the set. Yeah I didn't think of that because I knew objects wouldn't work in the set
 
Yeah, a set of strings made it way easier.
I was little worried it would bite me in the ass in solution 2, but luckily it didn't.
 
1:50 PM
using Point = std::pair<std::int32_t, std::int32_t>; and then my visited points are just std::array<std::set<Point>, 9> visitedPoints; (although I should have made the arrays be 10 long instead).
I would have used unordered_set but the standard library doesn't provide a hash function for std::pair<typename T1, typename T2>
 
 
1 hour later…
3:20 PM
@MBraedley You're using C++, right?
@Ronan Speaking of which, been thinking of redoing part 2 for yesterday to be more efficient. I mean it still runs instantly, but still!
It visits each node more times than it needs to.
 
@Wipqozn yeah
 
@MBraedley I haven't used C++ since university. First language I was taught though.
Which I think actually helped a lot. Startiong with something as low level as C++ really helps understanding the foundational stuff I find.
 
@Wipqozn I'm not sure how much better you can get other than the standard short circuit when you find the last visible tree.
@Wipqozn Modern C++ is generally not very low level. You can still do that, but the Core Guidelines and standard library tell you not to.
 
@MBraedley So I'm not short circuiting at all. For each tree, I'm stepping through in each direction until I find it's blocker. then I move to it's neighbor, and do the same thing. Would be more efficient to just try to calculate all trees in a column/row at once. So as I crawl, keep a list of trees, and when I find a tree blocking one in my list I calculate the distance and remove it from the list.
Something like that aywyas.
@MBraedley True!
but it allows low level, which is how I was moreso introduced to it. Well ,medium level maybe is the better term
like compared to C# or Pytohn
 
Except each tree is going to have a different blocker at each end.
 
3:29 PM
@MBraedley They will, which is why you have the list. You keep crawling until you reach the end. Or until the list is empty too would work.
and also the broader context here is my Tree object keeps track of it's own coordinates.
So if I've got:

4356

as a row...

When I go to calc the viewing distance for 4 to the right, it would check 3 first... see it's not a blocker. then it adds 3 to a list.Then I move to 5. At 5, I'm checking its height against 4 AND 3.

In this case it would see it's taller than both, so it would set 4.ViewingDistanceRight = abs(4.y - 5.y) and 3.ViewingDistanceRight = abs(3.y - 5.y)
Whereas what my code is doing now, is it would crawl to 5, and set the viewing distance for tree 4 (then calculates the other directions for 4). Then it would move to 3, crawl to 5 again, and then set the 3 viewing distance...
I hope I didn't explain that too poorly, ha.
 
Oh, so you'd be assigning viewing distances to a Tree and holding a list of Trees that are still visible. I didn't bother creating a tree class.
 
@MBraedley Yeah exactly.
 
You're still "visiting" each of those previous trees, though. It's maybe a slightly faster since there's less risk of a cache miss, but that's all you'd be saving.
 
@MBraedley I'm just visiting each tree less.
 
Not sure that you would be.
You would still need to hold on to that list of (4, 3, 5) because the next tree might be a 6
 
3:39 PM
@MBraedley I would be
ooh
wait I see what you're saying, right
I might not be doing as many "crawls" recursion wise, but I'm still doing the same number of comparisons.
Which is where the real operational cost is
 
Oh, I'm not doing any real recursion for that, it's a straight while loop.
 
@MBraedley yeah I'm doing recursion. Each tree keeps track of who it's neighbours are.
 
I risk cache misses because I don't transpose the forest when working in the vertical, but that's the biggest performance issue for me.
 
So it just keeps recursing in a single direction until it finds the end, or a tree blocking its view.
 
	std::int64_t nScore = 1;
	while( y - nScore >= 0 && startingTree > forest[y - nScore][x] )
	{
		nScore++;
	}
 
3:43 PM
once again, I always love seeing the different ways we all approach the same problem.
 
and then it gets adjusted back down if I hit the edge and short circuits if the test tree is on the edge
 
```
def PopulateTallestDirection(self, direction):
tree = self.trees[direction]
if direction in self.tallest:
return self.tallest[direction]

if tree is None:
self.tallest[direction] = None
return self.height

tallest = tree.PopulateTallestDirection(direction)
self.tallest[direction] = tallest if tallest is not None and tallest > tree.height else tree.height

return (self.height if (tallest is None) or (tallest < self.height) else tallest)
```
well that didn't work
```
def PopulateTallestDirection(self, direction):
tree = self.trees[direction]
if direction in self.tallest:
return self.tallest[direction]

if tree is None:
self.tallest[direction] = None
return self.height

tallest = tree.PopulateTallestDirection(direction)
self.tallest[direction] = tallest if tallest is not None and tallest > tree.height else tree.height

return (self.height if (tallest is None) or (tallest < self.height) else tallest)
```
I'm bad at this. Please don't take my diamond.
oh do you actually need to intent. Fuck that.
 
block code ticks don't work in chat, just indent with 4 spaces (or hit the fixed width button on desktop)
 
    def PopulateTallestDirection(self, direction):
        tree = self.trees[direction]
        if direction in self.tallest:
            return self.tallest[direction]

        if tree is None:
            self.tallest[direction] = None
            return self.height

        tallest = tree.PopulateTallestDirection(direction)
        self.tallest[direction] = tallest if tallest is not None and tallest > tree.height else tree.height

        return (self.height if (tallest is None) or (tallest < self.height) else tallest)
there we go
After spending so much time with C#, I no longer like the python ternary syntax.
Where direction is just "right", "left", et cetera
 
4:29 PM
Note to self: Do not try to play off a christopher judge speech that is going long with some 2 steps from hell. It will only HELP his speech
 
4:40 PM
@Fredy31 should have used karamelldansen
 
5:36 PM
Oh, crap
The trick I found for part 1 doesn't work on part 2
That sucks
It only works when leading knot moves in straight lines
 
5:50 PM
Wow, Brazil were just eliminated from the World Cup.
 
6:19 PM
@MBraedley Guess Croatia practiced their penalties
Also, just finished the game awards... and the bill clinton incident
that was a huge fuck up
 
7:17 PM
Yea, someone said that kid got arrested shortly afterwards
I was more interested in the flute guy, though
 
7:39 PM
Man, today's part 2 took me way too long
Mostly just tracking down small mistakes
It's fast, though
11ms for part 2
Just discovered console.time() lol
 
 
2 hours later…
9:23 PM
@Batophobia Geoff Keiley announced it on twitter.
And yeah I was watching the Easy Allies react and they had their time with that guy
because he was IN IT and every time they cut back to him the guy had a different fucking flute
But yeah I really wonder how security didn't catch that guy before he got to the mic
But i guess you cant expect security to know every dev in the room and who should/should not be on stage
and you dont want to take the guy out and oops, it was like the guy that translated the whole game from japanese to english or some exec that did participate to the project, just on the american or european side
 

« first day (4530 days earlier)      last day (518 days later) »