Struct alcibiades::Board [] [src]

pub struct Board {
    pub pieces: PiecesPlacement,
    pub to_move: Color,
    pub castling_rights: CastlingRights,
    pub enpassant_file: usize,
    pub occupied: Bitboard,
}

Holds a chess position.

Fields

The placement of the pieces on the board.

The side to move.

The castling rights for both players.

If the previous move was a double pawn push, contains pushed pawn's file (a value between 0 and 7). Otherwise contains 8.

The set of all occupied squares on the board.

Always equals self.pieces.color[WHITE] | self.pieces.color[BLACK]. Deserves a field on its own because it is very frequently needed.

Methods

impl Board
[src]

Creates a new instance from Forsyth–Edwards Notation (FEN).

Returns the square on given file and rank.

  • file should be a number between 0 and 7 (0 is file A, 7 is file H).
  • rank should be a number between 0 and 7 (0 is rank 1, 7 is rank 8).

Returns the file of a given square.

The returned number will be between 0 and 7 (0 is file A, 7 is file H).

Returns the rank of a given square.

The returned number will be between 0 and 7 (0 is rank 1, 7 is rank 8).

Trait Implementations

impl Clone for Board
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Board
[src]

Formats the value using the given formatter.