Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = [[White,White,Black],[White,Black,White]]
- board = [[[White,Black],[White,Black],[Black]],[[White,Black],[Black],[Black]]]
- doesBoardMatch a board
- doesBoardMatch :: [[Color]] -> [[[Color]]] -> Bool
- doesBoardMatch [] _ = True
- doesBoardMatch (x:xs) (y:ys) | (doesRowMatch x y) == False = False
- |otherwise = doesBoardMatch xs ys
- doesRowMatch :: [Color] -> [[Color]] -> Bool
- doesRowMatch [] _ = True
- doesRowMatch (x:xs) (y:ys) | (isInArr x y) == False = False
- |otherwise = doesRowMatch xs ys
- isInArr :: Eq t => t -> [t] -> Bool
- inInArr t [] = False
- isInArr t (x:xs) | t==x = True
- | otherwise = isInArr t xs
- SPOP: SPOP.hs:(147,1)-(148,44): Non-exhaustive patterns in function isInArr
- wywala sie jak powinno zwrócić false
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement