func Abs
Abs returns the absolute value of an integer
Abs returns the absolute value of an integer
GetPieceEmoji converts a piece character string to a unicode chess emoji
1func HasAnyLegalMoves(board Board, isWhite bool, rights CastlingRights, enPassantCol int) boolHasAnyLegalMoves checks if the current player has at least one legal move
IsBlackPiece returns true if the piece belongs to Black
IsKingInCheck checks if the king of the specified color is under attack
IsOpponentOrEmpty checks if destination square is empty or has an opponent piece
IsPathClear checks if all squares between from and to (exclusive) are empty
IsValidBishopMove validates bishop diagonal moves
1func IsValidKingMove(board Board, fromRow, fromCol, toRow, toCol int, isWhite bool, rights CastlingRights) boolIsValidKingMove validates king standard 1-square moves and castling (O-O and O-O-O)
IsValidKnightMove validates knight L-shaped moves
1func IsValidMove(board Board, fromRow, fromCol, toRow, toCol int, isWhiteTurn bool, rights CastlingRights, enPassantCol int) boolIsValidMove checks if a move from (fromRow, fromCol) to (toRow, toCol) is valid
1func IsValidPawnMove(board Board, fromRow, fromCol, toRow, toCol int, isWhite bool, enPassantCol int) boolIsValidPawnMove validates pawn movements including double step and en passant
IsValidQueenMove validates queen diagonal or straight moves
IsValidRookMove validates rook straight line moves
IsWhitePiece returns true if the piece belongs to White
NormalizePromotionPiece validates and normalizes the promotion piece symbol
1func ParseUCIMove(uci string) (fromRow, fromCol, toRow, toCol int, promoPiece string, err error)ParseUCIMove parses a standard UCI move string (e.g. "e2e4", "e7e8q")
1func ApplyMove(board Board, fromRow, fromCol, toRow, toCol int, promoPiece string, isWhiteTurn bool, rights *CastlingRights, enPassantCol *int) (Board, error)ApplyMove applies a move to the board after validating it, updating castling rights and en passant.
NewInitialBoard returns the standard starting position for a chess game
ReplayUCI replays the entire sequence of chess moves from the beginning using UCI notation. Returns status ("PLAYING", "WHITE_WON", "BLACK_WON", "DRAW").
Board represents an 8x8 chess board matrix
CastlingRights tracks whether king or rooks have moved