Day 14 but kind of shitty
This commit is contained in:
11
day14/Part1.hs
Normal file
11
day14/Part1.hs
Normal 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
|
||||
Reference in New Issue
Block a user