Chess Engine
C++ chess engine with movegen, bitboards, and Arduino-friendly docs
|
Go to the source code of this file.
Functions | |
int | MoveListOk (const S_MOVELIST *moves, const S_BOARD *board) |
Validates that a move list is within bounds and references valid moves. | |
int | SqIs120 (const int sq) |
Checks if a given square index is within the 120-based range. | |
int | PceValidEmptyOffbrd (const int pce) |
Checks if the given piece code is empty, valid, or OFFBOARD. | |
int | SqOnBoard (const int sq) |
Checks if a given square index refers to a valid on-board square. | |
int | SideValid (const int side) |
Checks if the given side identifier is valid. | |
int | FileRankValid (const int fr) |
Checks if a file or rank index is valid (0–7). | |
int | pieceValueidEmpty (const int pce) |
Checks if the given piece code is either empty or a valid piece. | |
int | pieceValueid (const int pce) |
Checks if the given piece code is a valid piece (non-empty). |
int FileRankValid | ( | const int | fr | ) |
Checks if a file or rank index is valid (0–7).
fr | The file or rank index. |
Definition at line 38 of file validate.cpp.
int MoveListOk | ( | const S_MOVELIST * | list, |
const S_BOARD * | pos ) |
Validates that a move list is within bounds and references valid moves.
list | Pointer to the move list. |
pos | Pointer to the board state. |
Definition at line 7 of file validate.cpp.
References S_MOVELIST::count, FALSE, FROMSQ, MAXPOSITIONMOVES, S_MOVE::move, S_MOVELIST::moves, S_BOARD::pieces, pieceValueidEmpty(), SqOnBoard(), TOSQ, and TRUE.
Referenced by generateAllCaptures(), and generateAllMoves().
int PceValidEmptyOffbrd | ( | const int | pce | ) |
Checks if the given piece code is empty, valid, or OFFBOARD.
pce | Piece code to check. |
Definition at line 25 of file validate.cpp.
References bK, EMPTY, and OFFBOARD.
Referenced by isSquareAttacked(), and updateListsMaterial().
int pieceValueid | ( | const int | pce | ) |
Checks if the given piece code is a valid piece (non-empty).
pce | Piece code to check. |
Definition at line 46 of file validate.cpp.
Referenced by AddCaptureMove(), AddPiece(), ClearPiece(), generateAllCaptures(), generateAllMoves(), makeMove(), MovePiece(), and takeMove().
int pieceValueidEmpty | ( | const int | pce | ) |
Checks if the given piece code is either empty or a valid piece.
pce | Piece code to check. |
Definition at line 42 of file validate.cpp.
Referenced by AddBlackPawnCapMove(), AddWhitePawnCapMove(), and MoveListOk().
int SideValid | ( | const int | side | ) |
Checks if the given side identifier is valid.
side | Side value to check (WHITE or BLACK). |
Definition at line 34 of file validate.cpp.
Referenced by AddPiece(), ClearPiece(), isSquareAttacked(), makeMove(), MovePiece(), and updateListsMaterial().
int SqIs120 | ( | const int | sq | ) |
Checks if a given square index is within the 120-based range.
sq | The square index to check. |
Definition at line 21 of file validate.cpp.
References BRD_SQ_NUM.
Referenced by isSquareAttacked().
int SqOnBoard | ( | const int | sq | ) |
Checks if a given square index refers to a valid on-board square.
sq | The 120-based square index. |
Definition at line 29 of file validate.cpp.
References BRD_SQ_NUM, fileIndex120, and OFFBOARD.
Referenced by AddBlackPawnCapMove(), AddBlackPawnMove(), AddCaptureMove(), AddEnPassantMove(), AddPiece(), AddQuietMove(), AddWhitePawnCapMove(), AddWhitePawnMove(), ClearPiece(), generateAllCaptures(), generateAllMoves(), generatePositionKeys(), initSquareIndexMaps(), isPieceListValid(), isSquareAttacked(), makeMove(), MoveListOk(), MovePiece(), parseMoveString(), and takeMove().