mirror of
https://github.com/mx42/adventofcode.git
synced 2026-01-14 22:09:50 +01:00
Fix typo in 2020 day 18
This commit is contained in:
@@ -19,7 +19,7 @@ evaluate input = fst $ foldl doOp (0, "") input
|
|||||||
doOp (res, "+") c = (res + (read c), "")
|
doOp (res, "+") c = (res + (read c), "")
|
||||||
doOp (res, "*") c = (res * (read c), "")
|
doOp (res, "*") c = (res * (read c), "")
|
||||||
doOp (res, "") c = (res, c)
|
doOp (res, "") c = (res, c)
|
||||||
doOp e c = error ("Invalid fold on " ++ show (e,c) ++ " in " ++ input)
|
doOp e c = error ("Invalid fold on " ++ show (e,c) ++ " in " ++ show input)
|
||||||
|
|
||||||
-- Evaluate an expression (for part 2) by doing +'s first then calling P1 evaluate function
|
-- Evaluate an expression (for part 2) by doing +'s first then calling P1 evaluate function
|
||||||
evaluateP2 :: [String] -> Int
|
evaluateP2 :: [String] -> Int
|
||||||
|
|||||||
Reference in New Issue
Block a user