12 lines
360 B
Haskell
12 lines
360 B
Haskell
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
|