Crates.io | aors |
lib.rs | aors |
version | 0.4.0 |
source | src |
created_at | 2023-10-21 15:19:24.846624 |
updated_at | 2023-12-10 10:58:03.969787 |
description | Useful rs tools for Advent of Code |
homepage | |
repository | https://github.com/JoelEng/AdventOfRS |
max_upload_size | |
id | 1010080 |
size | 39,126 |
Useful rs tools for Advent of Code.
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.
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
phi()
functionThe 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.
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.