My solution for Advent of Code problems
- Get your AoC session cookie and put it in a
.env(session=XXXXX) - Also set your email in
.envto fill request headers (email=XXXXXX) - Install requirements using
pipenv install
The package will install a typer-based cli named aoc. You can use it as follow:
aoc prepare 2022: Will create the directories for each day of year 2022 using the template inyear_template.aoc download 1 2022: Will download the input for problem 1 of year 2022 (NB: You need to runprepare_yearfirst).aoc run 1 2022: Will run thesolution.pyfile for problem 1 of year 2022.aoc submit 3 1 2022: Will submit solution for part 1 of day 3 of year 2022.aoc get-starsto update the README badges.
By default, day and year values are the current day and year. Run aoc --help for more details
- When data become available, run
aoc download. - Implement your solution in the
solve_part_1andsolve_part_2functions. - Use
aoc submitto submit any part once you are satisfied with it. You'll get any error message from AoC in the terminal.