remembered /= exists

This commit is contained in:
Thorn Avery 2020-12-02 20:45:49 +13:00
parent eaf8b1c594
commit d83589875d

View File

@ -26,7 +26,7 @@ validB (Password a' b' t p) =
(False,False) -> False
(True,False) -> (p !! a) == t
(False,True) -> (p !! b) == t
_ -> xor ((p !! a) == t) ((p !! b) == t)
_ -> ((p !! a) == t) /= ((p !! b) == t)
where
a = (pred a')
b = (pred b')
@ -53,11 +53,6 @@ dropChar :: String -> String
dropChar [] = []
dropChar (_:ls) = ls
xor :: Bool -> Bool -> Bool
xor True False = True
xor False True = True
xor _ _ = False
inBounds :: Int -> Int -> String -> (Bool, Bool)
inBounds a b s = ( len >= a, len >= b )
where len = length s