From: Neil Smith Date: Sat, 3 Dec 2022 09:05:06 +0000 (+0000) Subject: Selecting case properly X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=e3148f938dcdeeda7da459cf2e153a4a712c2b5f;p=advent-of-code-22.git Selecting case properly --- diff --git a/advent03/Main.hs b/advent03/Main.hs index 409ca33..8ebba26 100644 --- a/advent03/Main.hs +++ b/advent03/Main.hs @@ -57,5 +57,5 @@ commonItem (Rucksack contents1 contents2) = S.findMin (c1 `S.intersection` c2) priority :: Char -> Int priority item - | item >= 'a' = ord item - ord 'a' + 1 + | isLower item = ord item - ord 'a' + 1 | otherwise = ord item - ord 'A' + 27