My attempts at the problems from Advent of Code using Python. Solutions are organised by year and day.
These solutions prioritise readability, maintainability, and real-world practices over speed of writing or competitive programming techniques. The goal is to craft production ready code, similar to what I'd write in my professional role.
Links to each of my completed solutions.
Day | 2024 | 2023 | 2022 | 2021 | 2020 | 2019 | 2018 | 2017 | 2016 | 2015 |
---|---|---|---|---|---|---|---|---|---|---|
01 | ⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||
02 | ⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||
03 | ⭐⭐ | ⭐⭐ | ⭐⭐ | ⭐⭐ | ||||||
04 | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||||
05 | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||||
06 | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||||
07 | ⭐⭐ | ⭐⭐ | ⭐⭐ | |||||||
08 | ⭐⭐ | ⭐⭐ | ||||||||
09 | ⭐⭐ | ⭐⭐ | ||||||||
10 | ⭐⭐ | |||||||||
11 | ⭐⭐ | |||||||||
12 | ||||||||||
13 | ||||||||||
14 | ||||||||||
15 | ||||||||||
16 | ||||||||||
17 | ||||||||||
18 | ||||||||||
19 | ||||||||||
20 | ||||||||||
21 | ||||||||||
22 | ||||||||||
23 | ||||||||||
24 |
If you are interested in running these solutions locally on your machine following the steps below.
Ensure you have access or installed:
- pyenv (to manage multiple versions of python)
- There is a
.python-version
file in each year's folder, which will instruct pyenv on what version to use.
- There is a
- A shell environment (e.g., Bash, Zsh)
- Make (to automate tasks via the Makefile)
- Git (to clone the repo)
All you need to do is clone the repo.
git clone [email protected]:JonoRicci/advent-of-code-python.git
Each year has its own isolated Python environment with a specific configuration, virtual environment, dependencies, and Python version. I only work on this repository once a year in December, so this setup allows me to upgrade Python or adjust configurations for the current year without needing to update or maintain solutions from previous years.
The year folder is the root directory, and all commands to execute the solutions are intended to be run from the year root directory.
Check the README for each year for specific usage.
- 📖 2024 README
- 📖 2023 README
- 📖 2022 README
- 📖 2021 README
- 📖 2020 README
- 📖 2019 README
- 📖 2018 README
- 📖 2017 README
- 📖 2016 README
- 📖 2015 README
I have library of common Advent of Code functions that I've packaged as a local helper module jono_aoc_helpers
. It includes such helpers as:
- ⬇️ Automatic puzzle input retrieval and caching
- 💾 Writing puzzle input to a file
- 🔍 Loading puzzle input in multiple data types
- 📖 Initiating logging
- 🛠️ Gathering command line arguments
- ⏰ Timing function execution time
These are included in the skeleton template files when setting up new day solutions. You can read more below:
I record the execution time of each part of a day's solution. You can view these below:
My puzzle inputs are not included in this repository, they are ignored via my .gitignore
file. My puzzle answers are included, as they are used in my tests to validate the solution works.
Please see the Advent of Code 2024 FAQ.
Can I copy/redistribute part of Advent of Code? Please don't. Advent of Code is free to use, not free to copy. If you're posting a code repository somewhere, please don't include parts of Advent of Code like the puzzle text or your inputs. If you're making a website, please don't make it look like Advent of Code or name it something similar.