A Cabal project for my solutions to Advent of Code 2023 puzzles using Haskell.
This is a cabal project with a library for each days solution and an app that runs all the solutions and prints the results.
There is a utility library which is added as a submodule.
Build and run from the root of the project using cabal
To build
cabal build all
While developing just use the repl and pipe data into it. To compile and run a solution for day <d>
cabal run aoc23 <d>
Clone the repository and the submodule.
I’m using cabal-docspec installed directly, without Hackage. (I had to enable a lower version of GHC).
cabal build all
cabal-docspec
from the root of the project to run the tests.
I’m not including my inputs.
The code requires each input to be of the form day<xx>.txt
so add the requisite ones before trying to evaluate any solution.
I use aocd to fetch and cache the inputs for my registered user id.
To fetch all inputs run ./fetch_inputs.sh
from the project root. If they have been cached, this shouldn’t take too long.
For getting individual day’s inputs while participating, cd
into the input directory for that year and run aocd > dayxx.txt
or aocd yyyy dd |> dayxx.txt
in the inputs directory
Licensed under the MIT License.
Day | Part One | Rank | Part Two | Rank | Title |
---|---|---|---|---|---|
1 | 55477 | 17538 | 54431 | 23788 | Trebuchet?! |
2 | 2162 | 22610 | 72513 | 21691 | Cube Conundrum |
3 | 525911 | 113622 | 467835 | 98957 | Gear Ratios |
4 | 26346 | 24758 | 8467762 | 38000 | Scratchcards |
5 | 650599855 | 102932 | 1240035 | 75410 | If You Give A Seed A Fertilizer |
6 | 2344708 | 37412 | 30125202 | 35974 | Wait For It |
7 | 253313241 | 13241 | 253362743 | 13727 | Camel Cards |
8 | 19667 | 30001 | 19185263738117 | 59049 | Haunted Wasteland |
9 | 1901217887 | 14603 | 905 | 14054 | Mirage Maintenance |
10 | 6903 | 60309 | 265 | 44446 | Pipe Maze |
11 | 9543156 | 32200 | 625243292686 | 29772 | Cosmic Expansion |
12 | 7344 | 18273 | 1088006519007 | 8078 | Hot Springs |
13 | 37381 | 12595 | 28210 | 9562 | Point of Incidence |
14 | 19391 | 19391 | 86069 | 29054 | Parabolic Reflector Dish |
15 | 505379 | 20472 | 263211 | 32117 | Lens Library |
16 | 6361 | 29258 | 6701 | 28428 | The Floor Will Be Lava |
17 | 866 | 20932 | 1010 | 19911 | Clumsy Crucible |
18 | 40745 | 12609 | 90111113594927 | 8435 | Lavaduct Lagoon |
19 | Aplenty | ||||
20 | Pulse Propagation | ||||
21 | Step Counter | ||||
22 | Sand Slabs | ||||
23 | 2370 | 12114 | 6546 | 8829 | A Long Walk |
24 | |||||
25 |