2024 Solutions
2023 Solutions
- Day 1: Trebuchet?!
- Day 2: Cube Conundrum
- Day 3: Gear Ratios
- Day 4: Scratchcards
- Day 5: If You Give A Seed A Fertilizer
- Day 6: Wait For It
- Day 7: Camel Cards
- Day 8: Haunted Wasteland
- Day 9: Mirage Maintenance
- Day 10: Pipe Maze
- Day 11: Cosmic Expansion
- Day 12: Hot Springs
- Day 13: Point of Incidence
- Day 14: Parabolic Reflector Dish
- Day 15: Lens Library
- Day 16: The Floor Will Be Lava
- Day 17: Clumsy Crucible
- Day 18: Lavaduct Lagoon
- Day 19: Aplenty
- Day 20: Pulse Propagation
- Day 21: Step Counter
- Day 22: Sand Slabs
- Day 23: A Long Walk
- Day 24: Never Tell Me The Odds
- Day 25: Snowverload
2022 Solutions
- Day 1: Calorie Counting
- Day 2: Rock Paper Scissors
- Day 3: Rucksack Reorganization
- Day 4: Camp Cleanup
- Day 5: Supply Stacks
- Day 6: Tuning Trouble
- Day 7: No Space Left On Device
- Day 8: Treetop Tree House
- Day 9: Rope Bridge
- Day 10: Cathode-Ray Tube
- Day 11: Monkey in the Middle
- Day 12: Hill Climbing Algorithm
- Day 13: Distress Signal
- Day 14: Regolith Reservoir
- Day 15: Beacon Exclusion Zone
- Day 16: Proboscidea Volcanium
- Day 17: Pyroclastic Flow
- Day 18: Boiling Boulders
- Day 19: Not Enough Minerals
- Day 20: Grove Positioning System
- Day 21: Monkey Math
- Day 22: Monkey Map
- Day 23: Unstable Diffusion
- Day 24: Blizzard Basin
- Day 25: Full of Hot Air
I've written a basic runner (run.py) which allows you to conveniently run puzzles from a CLI. If you are using my devcontainer, the runner can also be run using the aoc
command rather than calling the Python script directly. See the help text below for usage:
usage: run.py -y YEAR -d DAY [-p PART] [-r | -t | -i | -o | -s] [-f] [-h]
-
-y
/--year
and-d
/--day
: These are required arguments that determine what.py
file is imported as a module. All other arguments are optional. -
-p
/--part
: Allows you select only a specific part to run. By default, both parts will run if found. -
-r
/--run
: This is the default option when no other option is selected. This will download your puzzle input and pass it to your solver (imported from your solution aspart1
orpart2
taking astr
input and returningAny
) to be run. -
-t
/--test
: Imports constants defined in your solution namedPART1_TESTS
andPART2_TESTS
if found, each being alist[tuple[str, Any]]
, with the tuples being the test inputs and expected outputs. These will be passed to your solver to be run. -
-i
/--input
: Downloads your puzzle input and prints it. -
-o
/--open
: Opens the puzzle URL in your browser. -
-s
/--start
: Starts a new puzzle by copyingtemplate.py
, then opening the new file (if run inside VSCode), opening the puzzle page in the browser, and printing the puzzle input. -
-f
/--fast
: By default, when the solver is run it will repeatedly run for 1 second and print the median execution time. With the-f
option, it will only run once.
Note
The runner expects the environment variable AOC_SESSION
to be set in order to download your input. See wimglenn/advent-of-code-wim#1 for more information.