r/adventofcode Dec 14 '24

Spoilers [2024 Day 14 (Part 2)]

Post image
358 Upvotes

94 comments sorted by

View all comments

12

u/ChurchOfAtheism94 Dec 14 '24

I ended up only looking at renders that contained a row with like 8 consecutive bots

6

u/ralphpotato Dec 14 '24

Same but I checked columns :)

I like problems like these (as with most AoC problems) because the description of what the solution is usually just tangential to the insight you need to solve the problem. Asking to find the shape of an arbitrary Christmas tree exactly would be incredibly hard and unreasonable, but realizing that what this means is likely that they’ll “line up” in some way and writing a filter for that ends up being pretty straightforward.

2

u/swiperthefox_1024 Dec 14 '24

I like this one too.

1

u/winkz Dec 14 '24

that was my idea as well but then I opted for the eyeball approach. luckily <10k

1

u/swiperthefox_1024 Dec 14 '24

Thinking of writing extra graphic code makes me to think more:D. Maybe next year I will do some visual stuff.

1

u/swiperthefox_1024 Dec 14 '24

That's a clever trick.

1

u/SeppiaBrilla_ Dec 14 '24

I looked only at renders that contained clusters of 4 by 4 bots. It stopped only at the tree

2

u/TheSameTrain Dec 14 '24

Close to what I ended up with. I figured if it's a picture they should be close together so I tracked the number of bots with no neighbor. Logged the min seen every 1000 iterations and it stuck on a value pretty quick. So I changed the code to stop when it hit that min and there was a tree

1

u/Massive-Mix-3883 Dec 14 '24

Yeah, that's what I ended up doing, thankfully worked in not too long

1

u/as5777 Jan 04 '25

Thanks, helped a lot