Crate myopic_board[][src]

Modules

constants
enumset

A library for defining enums that can be used in compact bit sets. It supports enums up to 128 variants, and has a macro to use these sets in constants.

hash

Structs

BitBoard

A bitboard is a value type wrapping a 64 bit integer which represents a set of squares on a chess board. Each bit is mapped to a particular square on the board, 0 -> H1, 1 -> G1,…, 8 -> H2,…, 63 -> A8. For example if we know a piece to reside on a particular square we can use a bitboard to to capture the available moves for that piece.

Board
UciMove

String wrapper representing a chess move formatted using the uci standard. We can use this to reflect moves outside the context of a board.

Enums

CastleZone

Represents one of the four different areas on a chessboard where the special castling move can take place (two for each side).

Dir

Type representing a square on a chessboard.

FenComponent

Represents the individual components which make up a board position encoded as a FEN string.

Move
MoveComputeType
Piece

Value type wrapping a single integer representing one of the 12 different pieces in a game of chess.

Side

Represents the two different teams in a game of chess.

Square

Type representing a square on a chessboard.

Termination

Represents the possible ways a game can be terminated, we only consider a game to be terminated when a side has no legal moves to make or if a special draw condition is met like position repetition. If a side has no legal moves and is currently in check then the game is lost, if it is not in check then the game is drawn.

Constants

STARTPOS_FEN

The start position of a chess game encoded in FEN format

Traits

ChessBoard

Trait representing a mutable state of play of a chess game which can be evolved/devolved via (applicable) Move instances, compute the set of legal moves and queried for a variety of properties.

Reflectable

Chess is a symmetric game and this trait represents a component of the game which can be reflected to it’s symmetric opposite component.

Functions

start

Return the start position of a standard game