My solutions for Advent of Code.
2023 in Rust. Previous years:
It's not pretty, but sometimes it works(?):
The solutions for each day live in aoc/src/y2023/dDD.rs
where DD
is the
relevant day of the month. To implement a new solution, create a new file for
the appropriate day, and it will be automatically discovered by
MAGIC.
This can be automated by running:
make new
or
cargo run -- new
You can specify the day to create using:
cargo run -- new --day 12
Session key: To automatically download the inputs for a specific day, you'll
need to have your AofC session key saved somewhere. To find it, log into the
AoC website, and use the developer tools to look at
the cookies to find your session key. Then save that key to a file called
~/.config/aoc/key
. Then, the data files will be downloaded into
~/.cache/aoc/2023
as text files.
To run today's solution, use:
make
which expands into:
cargo run -- --today
To run all the checks and solutions, use:
make all
Copyright 2019-2023 Daniel Foreman-Mackey
Licensed under the Apache License.