Library used for data: https://github.com/wimglenn/advent-of-code-data.
Main things:
- Fetch your token (help)
- Save the value in
~/.config/aocd/token
# Today's data
aocd > in.txt
# Data of a specific puzzle
aocd 3 2020 > in.txtThere's a script to start a new day:
./new_day.sh <day_number>
Running the script will create a new folder with the template files for a Python solution
under python/<day_number> as well as a new file for a Rust solution in rust/src/day_<day_number>.rs.
For Python:
- Go to the directory of the day you want to run (e.g.
cd python/04) - Run
python sol.pyto run the solution against your individual input - ... or run
python sol.py Xto run the solution against the input stored in the filesX.txtin the same directory
For Rust:
rustup install nightly(only needed before running anything for the first time)cd rustcargo +nightly runwill run the solution for all dayscargo +nightly run Xwill run the solution for dayXcargo +nightly testwill run all testscargo +nightly test Xwill run tests for dayXcargo +nightly benchwill run all benchmarks