Skip to content

Latest commit

 

History

History
283 lines (256 loc) · 10.2 KB

File metadata and controls

283 lines (256 loc) · 10.2 KB

Advent of Code

My python solutions for Advent Of Code tasks.

I did some puzzles from 2015 to warm up for 2023. Check out my 2022 repo too.

Prerequisites

I ran this code on python 3.10.8. It might work on other python 3 versions too.

Create a virtual environment and install dependencies.

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Layout

Code for each day is in src/year{y}/day{d}.py.

Inputs use advent-of-code-data library. Export AOC_SESSION environment variable to get your own inputs. I also export AOC_DATA to put input files into a folder here.

# env.sh
export AOC_SESSION=cafef00db01dfaceba5eba11deadbeef
export AOC_DATA=/path/to/this/folder/aocdata

Usage

Solve all tasks from a year:

python src/solve.py --year {year}

Solve particular day:

python src/solve.py --year {year} --day {day}

Other options:

  • --year {year} --day {day} --input {filepath} - run on a specified input file

Animations

Some days include code to produce animations illustrating the solution.

You can see them by running

python src/vis.py --year {year} --day {day}

2024

Animations made with py5. I'm adding videos to this youtube playlist. Click an image to watch that video.

Day 2
Day 5
Day 7
Day 11 Day 12
Day 13
Day 17

2023

Animations made with pygame. I'm adding videos to this youtube playlist. Click an image to watch that video.

Day 9

(no vis for now)

Day 12

(what do I even show?..)

Day 13

(should be doable)

Day 15

(not as interesting)

Day 18

(no vis yet)

Day 20

Day 21

Day 22

Day 23

Day 24

Day 25