Each day, advent of code presents a challenge for those of brave heart to complete. This repo contains my answers to the 2021 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.11.5. Language for this years AOC solutions.
- black v23.9.1. Prettifier for python code.
- ruff v0.1.0. Linter for python code.
- isort v5.12.0. Sorts imports in python code.
- pytest v7.4.2. Testing framework for python code.
- pre-commit v3.5.0. Used for pre commit hooks.
All development was completed using PyCharm which is an awesome IDE.
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.11.5
Next I create a virtual environment for the project:
pyenv virtualenv 3.11.5 2021-advent-of-code
Then I activate the virtual environment:
pyenv activate 2021-advent-of-code
Finally, I install the dependencies:
pip install -r requirements-dev.txt
My environment is now setup and ready to go.
$ make test
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 | Sonar Sweep | 🌟 | 🌟 |
Day 02 | Dive! | 🌟 | 🌟 |
Day 03 | Binary Diagnostic | 🌟 | 🌟 |
Day 04 | Giant Squid | 🌟 | 🌟 |
Day 05 | Hydrothermal Venture | 🌟 | 🌟 |
Day 06 | Lanternfish | 🌟 | 🌟 |
Day 07 | The Treachery of Whales | 🌟 | 🌟 |
Day 08 | Seven Segment Search | 🌟 | 🌟 |
Day 09 | Smoke Basin | 🌟 | 🌟 |
Day 10 | Syntax Scoring | 🌟 | 🌟 |
Day 11 | Dumbo Octopus | 🌟 | 🌟 |
Day 12 | Passage Pathing | 🌟 | 🌟 |
Day 13 | Transparent Origami | 🌟 | 🌟 |
Day 14 | Extended Polymerization | 🌟 | 🌟 |
Day 15 | Chiton | 🌟 | 🌟 |
Day 16 | Packet Decoder | 🌟 | 🌟 |
Day 17 | Trick Shot | 🌟 | 🌟 |
Day 18 | Snailfish | ||
Day 19 | Beacon Scanner | ||
Day 20 | Trench Map | 🌟 | 🌟 |
Day 21 | Dirac Dice | 🌟 | |
Day 22 | Reactor Reboot | ||
Day 23 | Amphipod | 🌟 | |
Day 24 | Arithmetic Logic Unit | ||
Day 25 | Sea Cucumber |