mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 07:27:46 +00:00
Retire UCI_Chess960 option
We don't need that ! We can infere from starting fen string if we are in a Chess960 game or not. And note that this is a per-position property, not an application wide one. A nice trick is to use a custom manipulator (that is an enum actually) to keep using the handy operator<<() on the move when sending to std::cout, yes, I have indulged a bit here ;-) Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+8
-8
@@ -246,6 +246,10 @@ void Position::from_fen(const string& fen) {
|
||||
castleRightsMask[make_square(initialQRFile, RANK_1)] ^= WHITE_OOO;
|
||||
castleRightsMask[make_square(initialQRFile, RANK_8)] ^= BLACK_OOO;
|
||||
|
||||
isChess960 = initialKFile != FILE_E
|
||||
|| initialQRFile != FILE_A
|
||||
|| initialKRFile != FILE_H;
|
||||
|
||||
find_checkers();
|
||||
|
||||
st->key = compute_key();
|
||||
@@ -352,21 +356,17 @@ const string Position::to_fen() const {
|
||||
|
||||
if (st->castleRights != CASTLES_NONE)
|
||||
{
|
||||
const bool Chess960 = initialKFile != FILE_E
|
||||
|| initialQRFile != FILE_A
|
||||
|| initialKRFile != FILE_H;
|
||||
|
||||
if (can_castle_kingside(WHITE))
|
||||
fen += Chess960 ? char(toupper(file_to_char(initialKRFile))) : 'K';
|
||||
fen += isChess960 ? char(toupper(file_to_char(initialKRFile))) : 'K';
|
||||
|
||||
if (can_castle_queenside(WHITE))
|
||||
fen += Chess960 ? char(toupper(file_to_char(initialQRFile))) : 'Q';
|
||||
fen += isChess960 ? char(toupper(file_to_char(initialQRFile))) : 'Q';
|
||||
|
||||
if (can_castle_kingside(BLACK))
|
||||
fen += Chess960 ? file_to_char(initialKRFile) : 'k';
|
||||
fen += isChess960 ? file_to_char(initialKRFile) : 'k';
|
||||
|
||||
if (can_castle_queenside(BLACK))
|
||||
fen += Chess960 ? file_to_char(initialQRFile) : 'q';
|
||||
fen += isChess960 ? file_to_char(initialQRFile) : 'q';
|
||||
} else
|
||||
fen += '-';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user