Run solutions with stack like
cd 01
stack runghc Part1 < input.txt
or
cd 01
stack ghc Part1
./Part1 < input.txt
To pass flags use
stack runghc -- -i../:. Part1
Note: there’s no space between the flag and its argument.
-
Day 5 —
Part2
finishes in ~30 seconds when compiled. -
Day 13 —
Part2
finishes in ~13 minutes when compiled. -
Day 14 — feed
-i.:../10
toghci
orghc
in order to run or compile. -
Day 20 —
Part2
runs much faster when compiled; the solution is based on heuristic rather than a proof. -
Day 21 —
Part2
runs very slow, it could be optimized, because all 3x3 patterns can be treated independently from each other — divide and conquer. -
Day 23 — feed
-i.:../18
toghci
orghc
in order to run or compile. Compile the C code likegcc -Wall -o Part1 Part1.c
andgcc -Wall -o Part2 Part2.c -lm
.