gerikson

joined 1 year ago
[–] gerikson@awful.systems 3 points 1 week ago (1 children)

day 8 part 2

Eric added some 0s in the grid which fucked up my existence code, sneaky devil

[–] gerikson@awful.systems 2 points 1 week ago (1 children)

re: branch cutting

thanks for the tip, I looked into it again and I found I was cutting in the wrong place. Fixed now, and halves the time for part 2

[–] gerikson@awful.systems 4 points 1 week ago* (last edited 1 week ago) (5 children)

Re: day 7 parts 1 and 2

same here, I was dicking around with combinatorics to get all combos of plus and multiply but realized before I got to the end it was gonna take too long. Then I figured that a DFS was the way to go.

I tried to optimize a bit by exiting early if the cumulative result became too large, but for some reason that gave me incorrect (too low) answers. Part 2 runs in around 1 min anyway.

https://github.com/gustafe/aoc2024/blob/main/d07-Bridge-Repair.pl

[–] gerikson@awful.systems 5 points 1 week ago

Yes, the person briefly changed their username and then left the site (disowning their comments). There are 2 people with "inactive-user" comments in the thread that simply flounced off to greener pastures.

[–] gerikson@awful.systems 2 points 1 week ago* (last edited 1 week ago)

day 6

part 2

I also brute-forced this. I figured there's a bit optimization to be done if you "draw a line" to the next obstacle instead of going step by step, and also maybe exclude some areas, but in the end I just set an exit value to break if the number of steps exceeded a certain value and say that was a loop. Took almost 20m but a star is a star.

update I only added obstructions in the original path, which cut the time down to 5 minutes or so.

[–] gerikson@awful.systems 13 points 1 week ago

An update, a user stated, "with all love and respect": "people will not starting hating Brave but they will start to hate the mod who blocked Brave".

2 hours later they'd removed their account.

[–] gerikson@awful.systems 4 points 1 week ago* (last edited 1 week ago) (1 children)

Day 5 - Print Queue

day 5

urgh this took me much longer than it should have... part 1 was easy enough but then I got tied up in knots with part 2. Finally I just sorto-bogo-sorted it all into shape

Perl: https://github.com/gustafe/aoc2024/blob/main/d05-Print-Queue.pl

Recheck array size: 98
All rechecks passed after 5938 passes
Duration: 00h00m00s (634.007 ms)

[–] gerikson@awful.systems 9 points 1 week ago

Ed's intended audience is probably more familiar with Beckett's play than some random indie game engine.

[–] gerikson@awful.systems 2 points 2 weeks ago (1 children)

re: 4-2

is it really n^2 tho? You have to do a constant check around each element, but that does not increase with the number of elements. And you can optimize a bit by marking already seen 'A's as illegal states and don't have to check them when the next row is processed.

[–] gerikson@awful.systems 4 points 2 weeks ago* (last edited 2 weeks ago) (1 children)

Day 4 - Ceres Search

discussion

There's probably a smarter way to do this...

For part 1, I dumped everything into a matrix. Then I scanned it element by element. If I found an X, I searched in 8 directions from there and counted up if I found M A S in sequence.

For part 2 I searched for an A, checked each diagonal corner, and counted up if the opposites were M S or S M

https://github.com/gustafe/aoc2024/blob/main/d04-Ceres-Search.pl

[–] gerikson@awful.systems 12 points 2 weeks ago (3 children)

And right now South Korea's president has declared martial law and banned all political activity, I guess she'll be just fine with that.

 

"Oh no! - Anyway" meme intensifies.

 

Pretty soon, paying for all the APIs you need to make sure your Midjourney images are palatable will be enough to pay a human artist!

 

Also the hivemind seems to have taken against ~~tweets~~Xeets, a stunning reversal from last year when St. Elon was gonna usher in a new Dawn of civilized discourse.

 

Sorry for Twitter link...

view more: ‹ prev next ›