Advent of Code, 2025
Find a file
Max Bucknell 9cf528099c
All checks were successful
ci/woodpecker/push/main Pipeline was successful
Day 7 (#8)
Reviewed-on: #8
2025-12-07 10:20:16 +00:00
.woodpecker Improvements to CI branch detection 2025-12-02 23:17:33 -05:00
config Day 1, both parts (#1) 2025-12-02 04:51:13 +00:00
lib Day 7 (#8) 2025-12-07 10:20:16 +00:00
test Day 7 (#8) 2025-12-07 10:20:16 +00:00
.formatter.exs Initial commit, basic scaffolding 2025-11-28 11:37:02 -05:00
.gitignore Day 1, both parts (#1) 2025-12-02 04:51:13 +00:00
LICENCE.md Initial commit, basic scaffolding 2025-11-28 11:37:02 -05:00
mix.exs Initial commit, basic scaffolding 2025-11-28 11:37:02 -05:00
mix.lock Initial commit, basic scaffolding 2025-11-28 11:37:02 -05:00
README.md Initial commit, basic scaffolding 2025-11-28 11:37:02 -05:00

Advent of Code, 2025

We are back this year in Elixir. It's my favourite language, I haven't had a chance to write it all year, and I'm on leave for all of December. Every other language I considered felt like too much work, so I'm here again.

The framework here is basically identical to the one I developed last year, although slightly modernised.

Setup

Install deps by running:

mix deps.get

Instructions

Every exercise is implemented in lib/aoc/day_{n}.ex. The sample problems and solutions are implemented as unit tests, which can be run like so:

mix test
mix test test/aoc/day_01.exs

If you'd like to actually run a solution, there are a few options:

  • Pass the input to stdin:

    mix solve 10 a < input/day-10.txt
    
  • Automatically download the input and run the task:

    AOC_SESSID="..." mix solve --load 3 b
    

    Inputs for Advent of Code are different per user, so we need to authenticate to get yours. To get this session ID, make sure you're logged in, and then pull the value out of the session cookie from your browser's dev tools. These cookies last for over a month, so it'll be valid for the whole advent calendar. I recommend storing this in an environment variable.

This harness also supports benchmarking! This requires the AOC_SESSID var to be set as described above. After that, benchmarking is as simple as running:

mix bench 4 a