Day14, move stuff to libraries, aoc2024 -> samples, fix FC on an error

This commit is contained in:
2024-12-14 08:14:43 -08:00
parent 29abacfa6c
commit c5368edbbf
64 changed files with 241 additions and 1121 deletions

View File

@@ -16,21 +16,6 @@ gridPoints text = go 0 0 (unpack text) Nil
go row col ('\n' :: cs) points = go (row + 1) 0 cs points
go row col (c :: cs) points = go row (col + 1) cs ((c,row,col) :: points)
Point : U
Point = Int × Int
instance Add Point where
(a,b) + (c,d) = (a + c, b + d)
instance Sub Point where
(a,b) - (c,d) = (a - c, b - d)
instance Ord Point where
(a,b) < (c,d) = a < c || a == c && b < d
instance Eq Point where
(a,b) == (c,d) = a == c && b == d
-- TODO add parameter a and pass Char -> a into getGrid
Grid : U
Grid = SortedMap Point Int