Chess Engine
C++ chess engine with movegen, bitboards, and Arduino-friendly docs
|
#include "../defs.h"
Go to the source code of this file.
Functions | |
bool | isSquareAttacked (int sq, int side, const S_BOARD *pos) |
Determines if a given square is attacked by a given side. |
Variables | |
const int | knightDirection [8] |
Knight movement directions in 120-square board representation. | |
const int | rookDirection [4] |
Rook movement directions in 120-square board representation. | |
const int | bishopDirection [4] |
Bishop movement directions in 120-square board representation. | |
const int | kingDirection [8] |
King movement directions in 120-square board representation. |
|
extern |
Determines if a given square is attacked by a given side.
sq | Square index (120-based representation). |
side | Side to check for attacks (WHITE or BLACK). |
pos | Pointer to the current board state. |
Definition at line 9 of file attack.cpp.
References ASSERT, bishopDirection, bP, EMPTY, isBoardStateValid(), IsBQ, IsKi, IsKn, IsRQ, kingDirection, knightDirection, OFFBOARD, PceValidEmptyOffbrd(), pieceColor, S_BOARD::pieces, rookDirection, SideValid(), SqIs120(), SqOnBoard(), WHITE, and wP.
Referenced by generateAllMoves(), makeMove(), and makeNullMove().
|
extern |
Bishop movement directions in 120-square board representation.
Definition at line 6 of file attack.cpp.
Referenced by isSquareAttacked().
|
extern |
King movement directions in 120-square board representation.
Definition at line 7 of file attack.cpp.
Referenced by isSquareAttacked().
|
extern |
Knight movement directions in 120-square board representation.
Definition at line 4 of file attack.cpp.
Referenced by isSquareAttacked().
|
extern |
Rook movement directions in 120-square board representation.
Definition at line 5 of file attack.cpp.
Referenced by isSquareAttacked().