From e3148f938dcdeeda7da459cf2e153a4a712c2b5f Mon Sep 17 00:00:00 2001 From: Neil Smith Date: Sat, 3 Dec 2022 09:05:06 +0000 Subject: [PATCH] Selecting case properly --- advent03/Main.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.34.1