Solutions to all 500 puzzles from Advent of Code 2015-2024: https://adventofcode.com/
Almost all of this code was written as quickly as possible (about 6-10 hours per year), and never cleaned up after getting the correct answer out of it, so it's pretty horrible.
This was done in Rust, written almost entirely from scratch without the use of third-party libraries (because it's more fun to figure out and understand the algorithms myself), except for a few standard features that would be too hard or too boring to reimplement:
- Commonly used:
itertoolsforcollect_vec,permutations, etcpegfor parsing the more complicated syntaxes (I also triedlalrpopandpest, butpegworked the best)rayonfor easily parallelising some computations, because optimised brute force can be quicker than finding a cleverer algorithmstdobviously
- Rarely used:
crossbeamfor some multithreadingfancy-regexfor regexes with backrefsmd-5,hexfor puzzles that require MD5nalgebrafor some 2D/3D vectors, when I couldn't be bothered to do all the maths explicitlynumforbigintandrational, when brute-forcing and findingi128isn't big enoughserde_jsonfor parsing JSON subsetsthiserrorfor writing a reasonably-generic pathfinding library that was reused in many puzzles