Facebook
From Mungo Meerkat, 7 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 301
  1. -- wypisanie możliwych bić w postaci [((plansza, pozycja), sąsiedzi)]
  2. getPossibleKills :: ((Board,Position), [Position]) -> [(Board,Position)]
  3. getPossibleKills ((board,from), []) = []
  4. getPossibleKills ((board,from), neighbour) = map fst [((kill board from to, to), (getNeighbours (kill board from to) to)) | to <- map (findPositionAfterKill from) neighbour, isInside to, isEmptyField board to] ++ concatMap getPossibleKills [((kill board from to, to), getNeighbours (kill board from to) to) | to <- map (findPositionAfterKill from) neighbour, isInside to, isEmptyField board to]