Skip to content

mattnworb/advent-of-code

Folders and files

NameName
Last commit message
Last commit date
Mar 27, 2025
Dec 5, 2023
Feb 27, 2023
Feb 27, 2023
Dec 1, 2023
Mar 11, 2024
Dec 2, 2020
Dec 1, 2021
Dec 2, 2023
Dec 4, 2022
Dec 21, 2023
May 13, 2025
Jan 29, 2025
Sep 9, 2024
Mar 27, 2025

Repository files navigation

advent-of-code

Running

To run the problem for a day, run the Python module like

poetry run python -m y2020.problem01

The solution code generally has no dependencies outside of the standard library but for tests, formatting etc I'm using poetry to manage dependencies.

Setting up new problem

To generate code for a new problem/day from a template, run:

./new_problem.sh <year> <day number>

This will create files in a directory named y$YEAR/$DAY.

Tests

Run the tests (yes I wrote tests) with tox or pytest or to run them for just one problem, poetry run pytest <year>/<directory>.

Install the pre-commit hooks to keep the code nicely formatted via pre-commit with pre-commit install.

To benchmark one of the modules with timeit, can run something like:

python -m timeit -s 'import y2021.problem15; inp = open("y2021/problem15/input").read(-1).strip()' 'y2021.problem15.part1(inp)'
1 loop, best of 5: 938 msec per loop

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published