No description
  • Python 87.2%
  • Haskell 11.1%
  • Shell 1.3%
  • Makefile 0.4%
Find a file
2026-05-31 20:35:03 +02:00
haskell day 10 both parts 2020-12-10 15:37:53 +01:00
.gitignore removed haskell + git files from gitignore 2020-12-06 19:38:10 +01:00
day_1.py golf 2020-12-04 09:50:59 +01:00
day_2.py solutions for days 1-3 part 1+2 2020-12-03 22:14:36 +01:00
day_3.py golfier golf 2020-12-04 23:03:49 +01:00
day_4.py adapted the days that were joining and re-splitting their input 2020-12-06 13:16:28 +01:00
day_5.py this is the shortest i can manage to make it 2020-12-05 14:26:08 +01:00
day_6.py str.split instead of ident -> group.split() 2020-12-06 18:45:34 +01:00
day_7.py added test example: day 7 part 2 2020-12-07 19:41:05 +01:00
day_8.py cleanup 2020-12-13 00:18:06 +01:00
day_9.py day 9 part 1 golf 2020-12-09 11:09:44 +01:00
day_10.py made my own cached decorator 2020-12-10 15:50:45 +01:00
day_11.py day 11 part 2 2020-12-13 01:50:26 +01:00
day_12.py cleanup 2020-12-12 14:42:32 +01:00
day_13.py 2 not working approaches, one working solution for day 13 part 2 2020-12-13 23:07:52 +01:00
day_14.py cleanup 2020-12-14 14:04:57 +01:00
day_15.py included day 15 part 1 (uncommented), added possibly interesting prints 2020-12-15 18:13:22 +01:00
day_16.py cleanup 2020-12-16 16:56:17 +01:00
day_17_1.py cleanup 2020-12-18 00:49:24 +01:00
day_17_2.py cleanup 2020-12-18 00:49:24 +01:00
day_18.py day 18 part 2 + some minor stuff 2020-12-18 22:27:37 +01:00
day_19.py day 23 attempt? what happened here 2026-05-31 20:35:03 +02:00
day_22.py day 22 part 1 2020-12-22 13:02:14 +01:00
day_23.py day 23 attempt? what happened here 2026-05-31 20:35:03 +02:00
README.md added docs for test decorator 2020-12-07 19:38:16 +01:00
utils.py added an option to @run to use content as a path, in the case that urllib2 doesn't give you the input (as happened to me right now) 2020-12-18 21:27:28 +01:00

Advent of code 2020

This repository contains some utilities as well as my own solutions for advent of code.

Please, for your sake, DO NOT use the solutions if you don't understand them.

How to use run

utils.run is a function that takes a conversion function and returns a decorator that will call the decorated function with the inputs converted to the correct format. Usually this will be something like int or utils.identity.

The name of the decorated function should be of format prefix_<day>, as the decorator uses it to generate the correct download link.

To use it, you need a separate file env.py with a variable COOKIE that contains your session cookie for advent of code (because everyone's input is different)

from utils import run
@run(int)
def solution_1(some_list):
    return some_list[0]

test

utils.test has mostly the same semantics as utils.run, with the exception that it takes another examples argument, which is a tuple containing the day's example input. It will call the decorated function with each of the provided examples in the same way as run.