Advent of Code
Table of Contents
1. What is Advent of Code
Official FAQ (https://adventofcode.com/2025/about, fetched live) states the puzzles no longer run through Dec 25: "The puzzles still start on December 1st so that the day numbers make sense (Day 1 = Dec 1), and puzzles come out every day (ending mid-December)." The Dec 1-25 run applied 2015-2024; the 2025 edition (this note's own #+DATE is 2025-12-22) already used the shorter schedule.
Advent of Code is an annual programming challenge created by Eric Wastl. The puzzles start December 1st every year; the event ran daily through December 25th from 2015-2024, but starting with the 2025 edition it ends mid-December instead. Each day presents a two-part puzzle.
Each puzzle tells a story, often involving Santa, elves, and holiday-themed scenarios.
2. Problem-Solving Approaches
This directory's own pathfinding solution (d16p2.py, d16forward.py; Day 16 "Reindeer Maze") uses Dijkstra's algorithm via heapq (heappush/heappop over a priority queue), not plain breadth-first search -- confirmed by reading both files' dijkstra() functions, which import heapq and track visited states with cumulative cost.
Many challenges involve familiar patterns: priority-queue search (Dijkstra, used in this directory's Day 16 solution) for weighted pathfinding, dynamic programming for optimization, or recursive descent for parsing.
A key strategy is to solve the sample input first, verifying your understanding before tackling the full dataset. Part two of each puzzle typically extends or twists the original problem, often requiring optimization or a fundamental rethinking of your approach.
3. Language Choices
This directory contains Python solutions only (14 .py files) plus one Emacs Lisp game (lisp/warehouse-game.el); no .scm or .clj files exist anywhere in the repository's Advent of Code material. A Clojure Advent of Code note exists but is a separate page for a different year (site/events/aoc-2021.org, 2021), not part of this directory. grep confirms itertools/collections/re usage in d14anom.py, d15.py, and d16p2.py.
This directory's solutions are Python only, plus one Emacs Lisp warehouse-pushing game. Python's standard library – itertools, collections, and re – covers the parsing these puzzles need. Scheme is not used for Advent of Code anywhere in this repository; a separate note, for a different year, covers Clojure solutions.
4. Learning Value and Community
Participants share solutions on Reddit, GitHub, and various forums.
5. Resources and Solutions
5.1. Official Site
- Advent of Code - Main website with all puzzles
5.2. Previous Solutions
Re-ran the Day 14 Part 2 "Christmas tree" search independently: computed the gzip-compressed byte length of all robots' x/y coordinates for steps 0-9999 against this directory's actual d14.in. The minimum-compression step is 7572, matching d14.out's claimed answer and the tree_step=7572 constant hardcoded in d14np.py. Note: d14.py's own curses-based is_christmas_tree() heuristic does NOT find a match within 10000 steps when run directly (`python3 d14.py solve d14.in --max-steps 10000`) -- the gzip-compression approach in d14np.py is the one that actually produced the answer.
- Python solutions only in this directory – see individual day files (d14.py, d15.py, etc.)
- Day 14 Part 2's answer (step 7572) was independently re-verified by execution (see drawer above)
5.3. Community Resources
- r/adventofcode - Active community discussion
- GitHub Topic: Advent of Code - Thousands of solution repositories
6. Related
- Advent of Code – the earlier note on the same puzzles
- Katas: Algorithms, Data Structures, and Problem Solving – smaller exercises of the same kind
- Dynamic Programming Tutorial – the technique half the late puzzles want
- Dijkstra's Algorithm Implementations – the other half