From ee1893cec07dcedb88bf112f0878874f594055d6 Mon Sep 17 00:00:00 2001 From: opfez Date: Sat, 4 Dec 2021 13:18:32 +0100 Subject: [PATCH] tiny day 4 cleanup --- day4/first.hs | 3 +-- day4/second.hs | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/day4/first.hs b/day4/first.hs index 3ccea49..58fb772 100644 --- a/day4/first.hs +++ b/day4/first.hs @@ -40,8 +40,7 @@ finalSum = aux 0 mark :: Integer -> Board -> Board mark n = map $ map conditionalMark where conditionalMark x - | n == 0 && x == 0 = -100 - | x == n = -x + | x == n = -1 | otherwise = x simulate :: Integer -> [Integer] -> [Board] -> Integer diff --git a/day4/second.hs b/day4/second.hs index 31d812a..06d7960 100644 --- a/day4/second.hs +++ b/day4/second.hs @@ -45,8 +45,7 @@ finalSum = aux 0 mark :: Integer -> Board -> Board mark n = map $ map conditionalMark where conditionalMark x - | n == 0 && x == 0 = -100 - | x == n = -x + | x == n = -1 | otherwise = x simulate :: Integer -> [Integer] -> [Board] -> Integer