cx-0.1.0.0: Chess eXperiment

Safe HaskellNone
LanguageHaskell2010

Game.Chess.Board

Synopsis

Documentation

isOnBoard :: (Num a, Bits a) => a -> Bool #

index :: Board -> Position -> Cell #

Index into the Board at the given Position. This function's safety is given by the fact that the fields of a Position can only be generated by smart constructors which guarantee that we remain within bounds.

As such, we don't return 'Maybe Cell' here.

emptyCell :: Position -> Board -> Board #

Changes the given Position on the given Board to contain an Empty Cell instead of a Cell. Yo dawg.

updateCell :: Position -> Cell -> Board -> Board #

Updates the given Position on the given Board to be the given Cell.

everyPiece :: Board -> Color -> Vector (Position, Cell) #

Get a list of every piece owned by a side, and the position it is at.

This is inefficient right now.

move :: Position -> Position -> Board -> Board #

Given Positions p1 and p2, replace p2's Cell with p1's Cell and set p1's Cell to Empty.

initialBoard :: Board #

An initial Board with all Pieces in their normal starting position.