Chess 0.0.1
A library written in c
Loading...
Searching...
No Matches
ChessPosition Struct Reference

Represents the position in a chess game. More...

#include <position.h>

Data Fields

ChessPiece board [128]
 
ChessColor side_to_move
 
ChessCastlingRights castling_rights
 
ChessSquare en_passant_square
 
unsigned int half_move_clock
 
unsigned int full_move_number
 
ChessSquare king_squares [CHESS_COLOR_BLACK+1]
 
ChessPositionCounter position_counter
 

Detailed Description

Represents the position in a chess game.

Field Documentation

◆ board

ChessPiece ChessPosition::board[128]

Array representing the pieces on each square (0x88 board).

◆ castling_rights

ChessCastlingRights ChessPosition::castling_rights

The current castling rights for both sides.

◆ en_passant_square

ChessSquare ChessPosition::en_passant_square

The square over which a pawn has just passed while moving two squares, or CHESS_SQUARE_NONE if not available.

◆ full_move_number

unsigned int ChessPosition::full_move_number

The number of the full moves. It starts at 1 and is incremented after Black's move.

◆ half_move_clock

unsigned int ChessPosition::half_move_clock

The number of halfmoves since the last capture or pawn advance, used for the fifty-move rule.

◆ king_squares

ChessSquare ChessPosition::king_squares[CHESS_COLOR_BLACK+1]

The squares of the White and Black kings.

◆ position_counter

ChessPositionCounter ChessPosition::position_counter

Counter for position repetitions (for threefold repetition rule).

◆ side_to_move

ChessColor ChessPosition::side_to_move

The color of the side to move next.


The documentation for this struct was generated from the following file: