remembered /= exists
This commit is contained in:
parent
eaf8b1c594
commit
d83589875d
7
day2.hs
7
day2.hs
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user