This is my "framework" for Advent of Code 2024. Written to make parsing and output pretty-printing nice, also allowing easier benchmarking among friends by making it easy to run old assingments instead of just doing them ad hoc in REPL environment.
I'm pretty sure there isn't a single person who is interested about using this, but in case you do, the license is GNU GPL 3.0 or (at your option) later. You may (at your option) also send me a post card for Christmas.
See my notes of daily tasks on the logbook page
sudo dnf install ghc-aeson-devel ghc-attoparsec-devel ghc-cmdargs-devel ghc-clock-devel ghc-fgl-devel
cabal install --overwrite-policy=always
sudo apt install libghc-aeson-dev libghc-attoparsec-dev libghc-cmdargs-dev libghc-clock-dev libghc-fgl-dev
cabal install --overwrite-policy=always
To run assignment for 2nd day, reading the input from default location, in this case inputs/02
:
~/.cabal/bin/aoc-zouppen-2024 2
To run assignment for 1st day, reading the input from specified file:
~/.cabal/bin/aoc-zouppen-2024 -f input.txt 1
To make test run for parser for day 1, with JSON output:
~/.cabal/bin/aoc-zouppen-2024 -f input.txt -j -p input 1
For full info, run ~/.cabal/bin/aoc-zouppen-2024 --help
.
I have made PDF generator for the daily puzzle which also automates other things. See tools.
During development, import module Tonttu
which contains function
parseBinFile
which can be used for running the parser in REPL
environment.
To add the assignment to the command-line utility, add the module to
files aoc-zouppen.cabal
and src/Tontut.hs
.