Advent of Code is a truly wonderful thing : a series of programming challenges that start on December 1 every year, and run through December. Day 1 is always easy, day 2 a little harder … and you get the idea, I tend to falter in the 20’s … my public repo shows my progress, with a ✓ if I got both parts, but a . if I only got the first part.
1111111111222222
1234567890123456789012345
2019 : ✓✓✓✓
2020 : ✓✓✓✓✓✓✓✓✓✓✓✓✓.
2021 : ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓ ✓✓ .
2022 : ✓✓✓✓✓✓✓✓✓✓✓✓✓✓ .✓.✓✓✓.✓✓.
2023 : ✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓✓....✓..
1234567890123456789012345
1111111111222222
It was created by Eric Wastl, and his presentation is well worth the hour … invented in 2015, it … took off in popularity rather faster than expected. From Wikipedia:
The event was initially launched on December 1, 2015. By midnight EST (UTC−05:00), 81 people had signed up for the event, going slightly over Wastl’s planned 70-participant capacity. Within 12 hours, about 4,000 people had joined, nearly causing a system crash. After 48 hours, there were about 15,000 people, and by the end of the 2015 event, the total had risen to 52,000.
In Dec 2022, it had a million registered users.
The format is always similar : it’s about helping elves to get ready for Christmas, and there’s always a whimsical / cheesy story, and completing each day builds up a pretty ASCII picture. The puzzles always come in two parts, with the first half leading you towards solving a problem, and then the second half pushing you to solve it at scale : brute force is never an option. For example, day 17 in 2023 was a route-finding problem, shortest path between two points, with the trick being you can take no more than 3 steps in one direction. This is the sample data …
… and this is the full path for the second half.
I often will usual visualisations to understand what’s going on.
(I’m watching his video again now, and at 8:00 he’s explaining where his capacity planning went wrong. “I have a few friends that might like it. They have a few friends that might like it. They have a few friends that might like it. And that part’s recursive …”)