Advent of Code solutions in Python 3.
- python 3.8+
- pytest 6.1+
Go to challenge year/day directory and type python3 <script_name>.py input.txt.gz
, for instance to run solution
for day 8 of AoC 2020:
cd 2020/Day_8
python3 handheld_halting.py input.txt.gz
You can pass a path to your own input files but you must gzip it first:
python3 handheld_halting.py /tmp/another_input_file.txt.gz
Every problem solution is designed to be easy to understand, unit testable, self-contained (including unit tests), idiomatic and to (ab)use type annotations.
Install pytest
:
pip install -r requirements.txt
To run all unit tests for all problems:
pytest **/*.py
To run unit tests for a specific problem:
pytest <path_to_problem>/*.py