These are my solutions to Advent of Code 2022. The solutions are in the __init__.py
files for each day's package. Sometimes, there is an solution in alternate.py
(or in an alternate
subpackage if the code needs to broken across modules. The main solution code is still in alternate/__init__.py
).
Try the problems yourself at https://adventofcode.com/2022/.
Feel free to create a Github issue if you want to discuss anything!
- Clone this repo:
git clone https://github.com/jkpr/advent-of-code-2022
- Change into the new directory:
cd advent-of-code-2022
- Run
make env
to build the environment. - Activate the environment with
source env/bin/activate
- Run a CLI for day
N
's code withpython3 -m aoc2021 -d N
, e.g.python3 -m aoc2021 -d 1
.
The CLI is common for each day. The main patterns for options are:
-t
to run part 1 withtest_input.txt
-2
to run part 2-t -2
to run part 2 withtest_input.txt
-t 1
to run part 1 withtest_input1.txt
-t 1 -2
to run part 2 withtest_input1.txt
a
to run the alternate solution
Day % 5 == 0 |
Day % 5 == 1 |
Day % 5 == 2 |
Day % 5 == 3 |
Day % 5 == 4 |
---|---|---|---|---|
1 · notes · code | 2 · notes · code | 3 · notes · code | 4 · notes · code | |
5 · notes · code | 6 · notes · code | 7 · notes · code | 8 · notes · code | 9 · notes · code |
10 · notes · code | 11 · notes · code | 12 · notes · code | 13 · notes · code | 14 · notes · code |
15 · notes · code | 16 · notes · code | 17 · notes · code | 18 · notes · code | 19 · notes · code |
20 · notes · code | 21 · notes · code | 22 · notes · code | 23 · notes · code | 24 · notes · code |
25 · notes · code |