|
All checks were successful
ci/woodpecker/push/main Pipeline was successful
Reviewed-on: #8 |
||
|---|---|---|
| .woodpecker | ||
| config | ||
| lib | ||
| test | ||
| .formatter.exs | ||
| .gitignore | ||
| LICENCE.md | ||
| mix.exs | ||
| mix.lock | ||
| README.md | ||
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 bInputs 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
sessioncookie 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