[ create a new paste ] login | about

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

Haskell, pasted on Oct 22:
1
2
3
4
5
nextPositionsN :: Board -> Int -> (Board -> Bool) -> [Board]
nextPositionsN b n pred = filter pred (helper [b] n) where
  helper x 0 = x
  helper x n | n > 0 =  helper (x >>= nextPositions) (n - 1)
             | otherwise = []


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


Create a new paste based on this one


Comments: