Welcome to Advent of Code 2024! This repository contains my solutions to the daily programming challenges hosted on Advent of Code.
Day | Part 1 | Part 2 |
---|---|---|
1 | ✅ | ✅ |
2 | ✅ | ✅ |
3 | ✅ | ✅ |
4 | ✅ | ✅ |
5 | ❌ | ❌ |
6 | ❌ | ❌ |
7 | ❌ | ❌ |
8 | ❌ | ❌ |
9 | ❌ | ❌ |
10 | ❌ | ❌ |
11 | ❌ | ❌ |
12 | ❌ | ❌ |
13 | ❌ | ❌ |
14 | ❌ | ❌ |
15 | ❌ | ❌ |
16 | ❌ | ❌ |
17 | ❌ | ❌ |
18 | ❌ | ❌ |
19 | ❌ | ❌ |
20 | ❌ | ❌ |
21 | ❌ | ❌ |
22 | ❌ | ❌ |
23 | ❌ | ❌ |
24 | ❌ | ❌ |
25 | ❌ | ❌ |
This project is written in Python and uses Poetry for dependency management. It also includes a Makefile
to simplify common tasks like testing, linting, and running solutions.
Ensure the following are installed:
- Python 3.11+
- Poetry
- Make (optional but recommended for automation)
-
Clone the repository:
git clone https://github.com/chris-spann/aoc_2024.git cd aoc_2024
-
Install dependencies:
poetry install
-
Activate the virtual environment:
poetry shell
Each day’s solution can be run using a Makefile command or directly via Python.
Run the solution for a specific day:
make run_day day=1
Replace 1
with the desired day number.
Run the solution directly:
poetry run python -m solutions.day_1
This project includes a Makefile with the following commands:
Command | Description |
---|---|
make test | Run the test suite using pytest. |
make lint | Run code linting and autofix issues with ruff. |
make format | Auto-format the codebase using ruff. |
make typecheck | Typechecking with pyright. |
make generate_day | Generate boilerplate code for a new day. |
make run_day day=X | Run the solution for a specific day. |
make update_progress | Update progress in README.md |
To generate boilerplate for a new day:
make generate_day
This runs the utils/generate_day.py
script to create the necessary files.
This project utilizes a pre-commit hook to update the Progress section of this readme that is triggered by a commit pushed with message Completed Day {puzzle_day_number} Part {part}
.
Tests are written using pytest
. Run them with:
make test
Use ruff
to lint and fix issues:
make lint
Format the code:
make format
Feel free to fork this repository, open issues, or submit pull requests if you have ideas or improvements. Happy coding! 🎄✨