Advent of Code 2024: Haskell Solution Reflections for all 25 Days
by Justin Le ♦
Admittedly a bit late, buuuuuut Merry belated Christmas and Happy New Years to all!
This past December I again participated in Eric Wastl’s Advent of Code, a series of 25 daily Christmas-themed puzzles. Each puzzle comes with a cute story about saving Christmas, and the puzzles increase in difficulty as the stakes get higher and higher. Every night at midnight EST, my friends and I (including the good people of libera chat’s ##advent-of-code
channel) discuss the latest puzzle and creative ways to solve and optimize it. But, the main goal isn’t to solve it quickly, it’s always to see creative ways to approach the puzzle and share different insights. The puzzles are bite-sized enough that there are often multiple ways to approach it, and in the past I’ve leveraged group theory, galilean transformations and linear algebra, and more group theory. This year was also the special 10 year anniversary event, with callbacks to fun story elements of all the previous years!
Most of the puzzles are also pretty nice to solve in Haskell! Lots of DFS’s that melt away as simple recursion or recursion schemes, and even the BFS’s that expose you to different data structures and encodings.
This year I’ve moved almost all of my Haskell code to an Advent of Code Megarepo. I also like to post write-ups on Haskelly ways to approach the problems, and they are auto-compiled on the megarepo wiki.
I try my best every year, but sometimes I am able to complete write-ups for all 25 puzzles before the new year catches up. The last time was 2020, and I’m proud to announce that 2024 is now also 100% complete!
You can find all of them here, but here are links to each individual one. Hopefully you can find them helpful. And if you haven’t yet, why not try Advent of Code yourself? :) And drop by the freenode ##advent-of-code
channel, we’d love to say hi and chat, or help out! Thanks all for reading, and also thanks to Eric for a great event this year, as always!
- Day 1 - Historian Hysteria
- Day 2 - Red-Nosed Reports
- Day 3 - Mull It Over
- Day 4 - Ceres Search
- Day 5 - Print Queue
- Day 6 - Guard Gallivant
- Day 7 - Bridge Repair
- Day 8 - Resonant Collinearity
- Day 9 - Disk Fragmenter
- Day 10 - Hoof It
- Day 11 - Plutonian Pebbles
- Day 12 - Garden Groups
- Day 13 - Claw Contraption
- Day 14 - Restrom Redoubt
- Day 15 - Warehouse Woes
- Day 16 - Reindeer Maze
- Day 17 - Chronospatial Computer
- Day 18 - RAM Run
- Day 19 - Linen Layout
- Day 20 - Race Condition
- Day 21 - Keypad Conundrum
- Day 22 - Monkey Market
- Day 23 - LAN Party
- Day 24 - Crossed Wires
- Day 25 - Code Chronicle