27 for (
int i = 0; i < 8; ++i) {
36 for (
int i = 0; i < 4; ++i) {
38 int targetSq = square + dir;
40 int piece = pos->
pieces[targetSq];
51 piece = pos->
pieces[targetSq];
56 for (
int i = 0; i < 4; ++i) {
58 int targetSq = square + dir;
60 int piece = pos->
pieces[targetSq];
71 piece = pos->
pieces[targetSq];
76 for (
int i = 0; i < 8; ++i) {
const int knightDirection[8]
Knight movement directions in 120-square board representation.
const int bishopDirection[4]
Bishop movement directions in 120-square board representation.
bool isSquareAttacked(const int square, const int side, const S_BOARD *pos)
Determines if a given square is attacked by a given side.
const int rookDirection[4]
Rook movement directions in 120-square board representation.
const int kingDirection[8]
King movement directions in 120-square board representation.
bool isBoardStateValid(const S_BOARD *pos)
Performs a full internal consistency check of the board state.
int pieceColor[13]
Color of each piece type.
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.