These are my solutions to Advent of Code
2021, written in Haskell. Each day can be found in the src
folder.
Just run ghc
manually on each day in the src
folder.
Solutions take input from standard input.
There's some scripts to help:
./fetch.sh <day>
: fetch input for the given day, putting it in theinputs
directory.- Requires
session.key
in the containing directory, which must contain yoursession
cookie from the Advent of Code website.
- Requires
./cmp.sh <day>
: compile the solution for the given day, outputting to theout
directory../run.sh <day> [--]
: run the solution for the given day. Always recompile. If--
is not provided, fetch input (withfetch.sh
) if not yet downloaded. With--
, just read input from stdin.
Most of the solutions have been rewritten in point-free
style for fun.
These solutions are not meant to be read, and most of them are, in
fact, quite incomprehensible. They are almost always entirely
equivalent to the normal, "pointful" solutions, which are preserved
below the point-free ones, usually with the function name main1
.