This commit is contained in:
2023-12-21 15:40:21 +01:00
parent def588730c
commit 52b197b49e
5 changed files with 133 additions and 0 deletions

9
day21/Part1.hs Normal file
View File

@@ -0,0 +1,9 @@
module Part1 where
import Commons
import Data.Array (Ix(inRange), bounds, (//), indices, array, assocs)
setStart :: Garden -> Garden
setStart garden = let ((yMin, xMin), (yMax, xMax)) = bounds garden
in garden // [((1 + div (yMax - yMin) 2, 1 + div (xMax - xMin) 2), Plot {reachable = True})]