Discussion thread for day 14 of the Advent of Code - https://adventofcode.com/2024/day/14
if [newgrid_px] < 0 THEN
[User.maxx] + [newgrid_px]
Else [newgrid_px]
ENDIf
Part 2 is similar to day 10 in 2018, where there is a point where the stars align, or in today's case the robots.Day 14 in the bag! Used @ScottLewis' tip for part 2 - looking for a line of 6 points returned a single output which was my Christmas tree! Not very neat so maybe my flow is off slightly but we picked up 2 stars!
Day14. More in spoiler
I update WF for P2 without checking thousands loops.
At first I could not imagine the goal picture.
Solved. I'm not sure how I feel about Part 2. I wouldn't have gotten there without the help from everyone. I definitely would've preferred more guidance on what "make a Xmas tree" actually looked like, since I assumed it was set in the middle of the graph
This was challenging but fun!
Formula Examples:
For Part 2, I iterated 10,000 times and then found the iteration with the smallest standard deviation between points. I got a lot of inspiration for this solution and visualization from some previous year solutions from @phottovy and @cgoodman3 that they highlighted recently. Without that, I would have spun my wheels trying to figure this one out. Just goes to show how much of a learning opportunity Advent of Code is!
There's probably a way to get the macro to exit early instead of hardcoding the iterations, but this only ran in 25.6 seconds so I'm OK with it the way it is :)
@Tokimatsu
Very brilliant idea.
I did same approach but went to calculate the area of Christmas Tree.
Just part 1 for me. Part 2 seems mad.