aors

Crates.ioaors
lib.rsaors
version0.4.0
sourcesrc
created_at2023-10-21 15:19:24.846624
updated_at2023-12-10 10:58:03.969787
descriptionUseful rs tools for Advent of Code
homepage
repositoryhttps://github.com/JoelEng/AdventOfRS
max_upload_size
id1010080
size39,126
Joel Engström (JoelEng)

documentation

README

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.

Commit count: 14

cargo fmt