codepad
[
create a new paste
]
login
|
about
Language:
C
C++
D
Haskell
Lua
OCaml
PHP
Perl
Plain Text
Python
Ruby
Scheme
Tcl
--Тип 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
Private
[
?
]
Run code
Submit