Facebook
From Round Pelican, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 339
  1. --wypisywanie mozliwych ruchów pionków
  2. getDraughtMoves :: Board -> Position -> [(Board,Position)]
  3. getDraughtMoves board (x,y) = [(move board (x,y) (a,b), (a,b)) | a <- [if ((isWhiteDraught board (x,y)) && (not $ isEmptyField board (x,y))) then (x-1) else if ((isBlackDraught board (x,y)) && (not $ isEmptyField board (x,y))) then (x+1) else 0], b <- [(y - 1),(y + 1)], isInside (a,b), isEmptyField board (a,b)]