- Python 87.2%
- Haskell 11.1%
- Shell 1.3%
- Makefile 0.4%
| haskell | ||
| .gitignore | ||
| day_1.py | ||
| day_2.py | ||
| day_3.py | ||
| day_4.py | ||
| day_5.py | ||
| day_6.py | ||
| day_7.py | ||
| day_8.py | ||
| day_9.py | ||
| day_10.py | ||
| day_11.py | ||
| day_12.py | ||
| day_13.py | ||
| day_14.py | ||
| day_15.py | ||
| day_16.py | ||
| day_17_1.py | ||
| day_17_2.py | ||
| day_18.py | ||
| day_19.py | ||
| day_22.py | ||
| day_23.py | ||
| README.md | ||
| utils.py | ||
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.