This suite can auto-download your personalized AoC input if you provide it with the session cookie from your logged in browser session.
- Log in to Advent of Code in your browser.
- Get the value of the cookie named "session" from the browser developer tools.
- Store the value in your dotenv, e.g. in the file
.env
in the repo root path. - Set a valid User-Agent for HTTP requests in your dotenv, as requested by the AoC creator in this post.
AOC_SESSION=5361[...]1448
USER_AGENT="github.com/your_username/your_clone_of_this_repo by [email protected]"
If you do not want to use the auto-download feature, provide the
downloaded AoC inputs manually with the following path scheme relative
to the repository root: input/year20xx/dayxx.input
.
The code should be run with the cargo run --release
command from the
root path of the repo.
Run the code for the latest day (no arguments):
cargo run --release
Run the code for a specific day of the most recent year:
cargo run --release 11
Run the code for a specific year / day:
cargo run --release 2016 11
Run all implemented days for a single year:
cargo run --release 2016 all
A solution for each day is implemented in a single Rust source file:
yearxxxx/src/dayxx.rs
.
Re-used code has been moved to the subcrate util
.
AoC example input is implemented as unit tests in the respective file.