Day 14 but kind of shitty

This commit is contained in:
2023-12-15 00:35:45 +01:00
parent a307b41ed8
commit 8614db903e
5 changed files with 108 additions and 0 deletions

11
day14/Part1.hs Normal file
View File

@@ -0,0 +1,11 @@
module Part1 where
import Commons
import Data.Array (bounds, assocs)
getLoads :: Platform -> [Int]
getLoads platform =
let (yMax, _) = snd $ bounds platform
tiltedPlatform = tilt (-1, 0) (map fst $ filter (\ (_, r) -> r == Round) $ assocs platform) platform
in map (\ ((y, _), r) -> if r == Round then yMax + 1 - y else 0) $ assocs tiltedPlatform