Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/cj81499/advent-of-code/llms.txt

Use this file to discover all available pages before exploring further.

Advent of Code 2019 covers all 25 days — 23 days fully solved (both parts), with Day 22 Part 2 and Day 25 Part 2 still outstanding. The defining feature of 2019 is the Intcode computer: a virtual machine introduced on Day 2 and reused on Days 5, 7, 9, 11, 13, 15, 17, 19, 21, 23, and 25. Mastering the Intcode VM is the key to the entire year. The year also includes orbital mechanics, stoichiometry, maze traversal, and a card-shuffling puzzle requiring modular arithmetic.

Progress

DayTitlePart 1Part 2Tests
01The Tyranny of the Rocket Equation
021202 Program Alarm
03Crossed Wires
04Secure Container
05Sunny with a Chance of Asteroids
06Universal Orbit Map
07Amplification Circuit
08Space Image Format
09Sensor Boost
10Monitoring Station
11Space Police
12The N-Body Problem
13Care Package
14Space Stoichiometry
15Oxygen System
16Flawed Frequency Transmission
17Set and Forget
18Many-Worlds Interpretation
19Tractor Beam
20Donut Maze
21Springdroid Adventure
22Slam Shuffle
23Category Six
24Planet of Discord
25Cryostasis

Notable Solutions

The Intcode Computer (intcode_computer.py)

The heart of 2019 is a reusable IntcodeProgram class. Memory is modelled as a defaultdict(int) to support sparse addressing. The VM supports all opcodes: add, multiply, input, output, jump-if-true, jump-if-false, less-than, equals, adjust-relative-base, and halt. Three parameter modes (position, immediate, relative) are decoded from the instruction value. An input queue and output deque allow programs to communicate asynchronously with the host.
class IntcodeProgram:
    def __init__(self, program: list[int]):
        self._memory = defaultdict(int, dict(enumerate(program)))
        self._ip = 0
        self._input_queue = deque()
        self.outputs = deque()
        self._relative_base = 0

    def run(self, max_steps=None):
        while not self.terminated and not self.is_waiting_for_input():
            self.run_next()

Day 2 — 1202 Program Alarm

The first Intcode puzzle: set memory[1] (noun) and memory[2] (verb), run the program, and read memory[0]. Part 2 brute-forces all 10,000 (noun, verb) pairs in range(100) × range(100) to find the combination that produces the target output 19690720.

Day 18 — Many-Worlds Interpretation

A BFS/Dijkstra search through a maze where keys (a–z) must be collected to unlock matching doors. The state includes current position(s) and the set of collected keys. This is one of the most complex puzzles of the year and uses priority-queue search to handle the exponentially large state space efficiently.
Puzzle inputs are personal and are not stored in this repository. Solutions fetch input at runtime using aocd (aocd.data).

Build docs developers (and LLMs) love