my solutions to AOC 2020 puzzles
use itertools to tighten up day 24 part 2
stars for day 24


browse  log 



You can also use your local clone with git send-email.

#Advent Of Code 2020

These are my solutions for 2020's advent of code. My plan this year is to use this to get my python as idiomatic as possible, but I may deviate depending on the size of my timebox for a given day, a whim, impatience, or specific characteristics of a puzzle that make some other tool on my belt seem better.

Any original code here is licensed under the MIT License. I probably won't take the time to vet any dependencies' licenses unless I copy them into this tree. In the unlikely event something from here is worth copying, the burden is on the copying party to check the suitability of the licenses for code that isn't mine.


A couple days into this year, I discovered the awesome aocd library that makes it really easy and convenient to get your own data from the advent of code site and to submit your candidate solutions.

To use the harness that way, get your advent of code session cookie from your browser and set it in the AOC_SESSION environment variable. I use a .env file for that.

pip install -r <requirements.txt
pip install -e .
aoc2020 [-v] run --day=X --part=Y

The cli module either accepts a file or uses aocd to download one and passes the resulting array of lines to that day's preprocess function. The return value from preprocess is passed to both part1 and part2 for the day. The structure may vary per day.

If you don't want to grab your cookie, a filename can be specified at the end of the command line. Results can then be submitted using copy and paste.