Back

AOC 2024 Day 14 Part 2 Visualization

12/15/2024

1 min

There’s a really cool event called advent of code that I enjoy participating in. It’s a problem solving “competition” that features 25 Christmas themed puzzles. It’s a lot of fun and sometimes frustrating, but there are always some very interesting puzzles from year to year. One of the puzzles for this year’s advent of code that I thought was super interesting was part 2 of day 14. You can read about it here, but the gist of it is that you need a way to be able to detect when the coordinates of most robots align to form a christmas tree.

There are a lot of ways to solve this challenge, but my brain at 2am was a little too drowsy for finding an optimized solution 😝. Instead I looked at times where the robots clustered to estimate a time frame for when the christmas tree forms. Then I simulated the robots and their positions at each time based on the previous estimates. Below is the end solution visualized (all positions from t = 6,000 seconds to t = 8,159 seconds).

This was a really cool challenge that forced me to think outside of the box, although it did take some manual labor 🙃. If this type of stuff floats your boat then you can go to adventofcode.com and start coding!



Thanks for reading. Cya 👋.