It took me the afternoon but I got a LSP working
This commit is contained in:
@@ -4,15 +4,14 @@ import Commons
|
||||
|
||||
|
||||
getMinCubesRound :: [Round] -> Round
|
||||
getMinCubesRound (round: []) = round
|
||||
getMinCubesRound [round] = round
|
||||
getMinCubesRound (round: otherRound: t) = getMinCubesRound (Round {red = max (red round) (red otherRound),
|
||||
green = max (green round) (green otherRound),
|
||||
blue = max (blue round) (blue otherRound)}: t)
|
||||
|
||||
getPowerGame :: Game -> Int
|
||||
getPowerGame Game{rounds=rounds} = let minRound = getMinCubesRound rounds
|
||||
in (red minRound) * (green minRound) * (blue minRound)
|
||||
in red minRound * green minRound * blue minRound
|
||||
|
||||
getPower :: [Game] -> [Int]
|
||||
getPower [] = []
|
||||
getPower (game: t) = (getPowerGame game: getPower t)
|
||||
getPower = map getPowerGame
|
||||
|
||||
Reference in New Issue
Block a user