8 unstable releases (3 breaking)
0.4.0 | Dec 10, 2023 |
---|---|
0.3.1 | Nov 25, 2023 |
0.2.0 | Oct 23, 2023 |
0.1.3 | Oct 22, 2023 |
#819 in Procedural macros
20KB
463 lines
aors - Advent of RS 🎄 🦀
Useful rs tools for Advent of Code.
Installation & Setup
cargo install aors # Install CLI
aors --init # Create a new project at current directory.
aors --year <YEAR> # Set year to solve
aors --cookie <COOKIE> # Set session cookie
COOKIE is your session cookie, acquired from the advent of code website like this.
The first command after this can take some time without output. This is completely normal.
Usage
aors # run all days
aors [DAYS] # run one or more specific days
aors [DAYS] -x # run with example input (--example also works)
aors [DAYS] -g # get input and create necessary files (--get also works)
# input_examples/<DAY>.in has to be filled in manually
aors [DAYS] -p # post output to Advent of Code (--post also works)
# submits part 2 if part 1 has already been submitted
The phi()
function
The puzzles sometimes require that different variables be used for the example problem and the actual problem, beyond just the input values. The built-in function phi()
is used to handle such situations.
phi()
takes two inputs actual
and example
of the same type. It returns actual
when solving the actual problem and example
when using example input.
Helper functions
If a function is needed in multiple days, it should be placed in the helpers
folder.
Initial project structure and setup kindly stolen from AxlLind. However, it has been greatly expanded upon since.
Dependencies
~6.5–9.5MB
~163K SLoC