Each day, advent of code presents a challenge for those of brave heart to complete. This repo contains my answers to the 2024 version of advent of code, not all challenges have been completed. I complete AoC to get familiar with a technology, its build tools and testing tools, it's kind of a mini-production type workflow I follow.
In this year I chose to use the following tools:
- Python v3.13.0. Language for this years AOC solutions.
- Mypy v1.13.0. Typing for Python code.
- ruff v0.8.0. Linter for python code.
- isort v5.13.2. Sorts imports in python code.
- pytest v8.3.3. Testing framework for python code.
- pre-commit v4.0.1. Used for pre commit hooks.
- uv 0.5.4. Used as the package manager in place of
pip
All development is completed using VS Code.
With Python, I like to work with virtual envs, this keeps the development environments for each project separate.
First step is to install the version of python to use. I use pyenv to manage my python versions, so I install the version I want to use with the following command:
╰─❯ pyenv install 3.13.0
Next I create a virtual environment for the project:
╰─❯ pyenv virtualenv 3.13.0 2024-aoc
Then I activate the virtual environment:
╰─❯ pyenv activate 2024-aoc
Install the dependencies:
╰─❯ make install
Finally, set up pre-commit:
╰─❯ pre-commit install
My environment is now setup and ready to go.
╰─❯ make test
To test a single test file, the following command can be used:
╰─❯ make test-file file=<relative_path_to_test>
For example, to test day 01 task 02, the following command can be used:
╰─❯ make test-file file=tests/day_01/test_task_02.py
The pre-commit hook should kick-in, when it does it will lint and prettify the code.
╰─❯ git add --all
╰─❯ git commit -a
Challenge | Task 1 | Task 2 | |
---|---|---|---|
Day 01 | Historian Hysteria | 🌟 | 🌟 |
Day 02 | Red-Nosed Reports | 🌟 | 🌟 |
Day 03 | Mull It Over | 🌟 | 🌟 |
Day 04 | Ceres Search | 🌟 | 🌟 |
Day 05 | Print Queue | 🌟 | 🌟 |
Day 06 | Guard Gallivant | 🌟 | 🌟 |
Day 07 | Bridge Repair | 🌟 | 🌟 |
Day 08 | Resonant Collinearity | 🌟 | 🌟 |
Day 09 | Disk Fragmenter | 🌟 | 🌟 |
Day 10 | Hoof It | 🌟 | 🌟 |
Day 11 | Plutonian Pebbles | 🌟 | 🌟 |
Day 12 | Garden Groups | 🌟 | 🌟 |
Day 13 | Claw Contraption | 🌟 | 🌟 |
Day 14 | Restroom Redoubt | 🌟 | 🌟 |
Day 15 | Warehouse Woes | 🌟 | 🌟 |
Day 16 | Reindeer Maze | 🌟 | |
Day 17 | Chronospatial Computer | 🌟 | 🌟 |
Day 18 | RAM Run | 🌟 | 🌟 |
Day 19 | Linen Layout | 🌟 | 🌟 |
Day 20 | Race Condition | ||
Day 21 | Keypad Conundrum | 🌟 | 🌟 |
Day 22 | Monkey Market | 🌟 | 🌟 |
Day 23 | LAN Party | 🌟 | 🌟 |
Day 24 | Crossed Wires | 🌟 | |
Day 25 | Code Chronicle | 🌟 |