Skip to content

JonoRicci/advent-of-code-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

2015: 18/50 2016: 0/50 2017: 0/50 2018: 0/50 2019: 0/50 2020: 22/50 2021: 14/50 2022: 4/50 2023: 0/50 2024: 6/50

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.

Table of Contents

Solutions

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

Setup

If you are interested in running these solutions locally on your machine following the steps below.

Requirements

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.
  • A shell environment (e.g., Bash, Zsh)
  • Make (to automate tasks via the Makefile)
  • Git (to clone the repo)

Installation

All you need to do is clone the repo.

git clone [email protected]:JonoRicci/advent-of-code-python.git

Usage

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.

Helper Module

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:

Execution Time

I record the execution time of each part of a day's solution. You can view these below:

Puzzle Inputs

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.

Links

About

My Python solutions to Advent of Code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published