This project contains solutions to the Advent of Code challenges solved in Python.
The project is structured as follows:
years
: Contains subfolders with the years.<years>
: Contains the solutions and the tests to the problems of that specific year.main.py
: Entry point to execute individual days or the entire set of days.days/
: Modules for each day's solution.data/
: Contains the input and the example provided for each problem.tests/
: Test modules corresponding to each day's solution.utils/
: Utility functions.
- Clone this repository.
- Create a virtual environment using
python -m venv venv_name
. - Activate the virtual environment:
- Windows:
venv_name\Scripts\activate
- Unix/MacOS:
source venv_name/bin/activate
- Windows:
- Install dependencies:
pip install -r requirements.txt
. - Run:
pre-commit install
to install the ruff pre commit analyzer.
- To run a single day's solutions:
python main.py --day <day_number>
- To run multiple days' solutions:
python main.py --day <day_number> <day_number> <day_number>
- To run all days' solutions:
python main.py
Place input data files for each day in the data/
directory. The code automatically reads input from these files.
You can also check my Rust implementation of 2022 Advent of code here.
This project is licensed under the MIT License.