Selecting case properly
authorNeil Smith <NeilNjae@users.noreply.github.com>
Sat, 3 Dec 2022 09:05:06 +0000 (09:05 +0000)
committerNeil Smith <NeilNjae@users.noreply.github.com>
Sat, 3 Dec 2022 09:05:06 +0000 (09:05 +0000)
advent03/Main.hs

index 409ca338c6cc396c83e41b9ab1be4b055582cf50..8ebba26fd8398332f51144bdb3432dd488bb251a 100644 (file)
@@ -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