[ create a new paste ] login | about

Link: http://codepad.org/DyVGR8UR    [ raw code | output | fork ]

Haskell, pasted on Oct 21:
1
2
3
4
5
6
7
8
9
--Тип Board и функция nextPositions заданы, реализовывать их не нужно

nextPositionsN :: Board -> Int -> (Board -> Bool) -> [Board]
nextPositionsN b n pred | n<0       = []
                        | n == 0    = if pred b then [b] else []
                        | otherwise = do
    np <- nextPositions b
    npr <- nextPositionsN np (n-1) pred
    return npr


Output:
1
2
Error occurred
ERROR line 3 - Undefined type constructor "Board"


Create a new paste based on this one


Comments: