aboutsummaryrefslogtreecommitdiffstats
path: root/day16/main.hs
diff options
context:
space:
mode:
authorJan Tuomi <jans.tuomi@gmail.com>2021-12-17 13:25:23 +0200
committerJan Tuomi <jans.tuomi@gmail.com>2021-12-17 13:25:23 +0200
commit63c1f74fe9a20984f6a19c3c2344793b1ed10072 (patch)
tree31c284f7a084bc6260a5134a781b656279e66ce1 /day16/main.hs
parent9578bb135a7cc00262281e448a151175b0825e7c (diff)
Day 17
Diffstat (limited to 'day16/main.hs')
-rw-r--r--day16/main.hs4
1 files changed, 0 insertions, 4 deletions
diff --git a/day16/main.hs b/day16/main.hs
index 76b3db1..56510ae 100644
--- a/day16/main.hs
+++ b/day16/main.hs
@@ -39,10 +39,6 @@ binaryToInt = reverse .> binaryToInt'
binaryToInt' [] = 0
binaryToInt' (x : xs) = digitToInt x + 2 * binaryToInt' xs
-takeUntil :: (a -> Bool) -> [a] -> [a]
-takeUntil _ [] = []
-takeUntil p (x : xs) = x : if p x then takeUntil p xs else []
-
applyOperator opTypeId subValues = case opTypeId of
0 -> sum subValues
1 -> product subValues