Repository of my code for Advent of Code
Clone the repository and install the project in your python environment, either using pip
git clone [email protected]:jonasrenault/advent.git
cd advent
pip install --editable .or uv
git clone [email protected]:jonasrenault/advent.git
cd advent
uv syncTo get the code to work with your puzzle input, you need to be logged in using your session cookie. Log in to the Advent of Code website and save your session cookie in a file called .secret-session-cookie in the project's root directory.
Each day's problem is solved in its own python module in a package corresponding to the year in the advent directory. To run a solution, run
python advent/advent2023/day01.py(prefix with uv run if using uv).
The Advent class in the advent.utils.utils module is used to get the input for a day's problem and submit solutions.
A CLI is provided to generate a blank template for a new day. Run
advent template [YEAR] [DAY](prefix with uv run if using uv) and replace [YEAR] and [DAY] with the year and day you want to generate a template for.