All occupied squares.
All squares occupied by pieces known to be promoted. This information is relevant in chess variants like Crazyhouse.
Finds the unique king of the given color, if any.
Resets all pieces to the default starting position for standard chess.
Removes and returns the piece from the given square, if any.
StaticdefaultStaticempty
Piece positions on a board.
Properties are sets of squares, like
board.occupiedfor all occupied squares,board[color]for all pieces of that color, andboard[role]for all pieces of that role. When modifying the properties directly, take care to keep them consistent.