For artistic purposes, I would like to create and study engine games in which only one side is able to castle.
For this, I need to compile a version of Stockfish which never castles, and doesn't consider its own castling in its calculations, whereas calculates with castling for the opponent.
I have gone through the types.h file and found the following:
enum MoveType {
NORMAL,
PROMOTION = 1 << 14,
ENPASSANT = 2 << 14,
CASTLING = 3 << 14
};
enum CastlingRights {
NO_CASTLING,
WHITE_OO,
WHITE_OOO = WHITE_OO << 1,
BLACK_OO = WHITE_OO << 2,
BLACK_OOO = WHITE_OO << 3,
KING_SIDE = WHITE_OO | BLACK_OO,
QUEEN_SIDE = WHITE_OOO | BLACK_OOO,
WHITE_CASTLING = WHITE_OO | WHITE_OOO,
BLACK_CASTLING = BLACK_OO | BLACK_OOO,
ANY_CASTLING = WHITE_CASTLING | BLACK_CASTLING,
CASTLING_RIGHT_NB = 16
};
What can I do to disable castling in moves and calculations of Stockfish?
BLACK_00 = 0, BLACK_000 = 0,
might work. Depends on how all the other code is written. – Aganju Jul 4 '20 at 1:21