mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-20 17:16:33 +08:00
Another attempt at fixing Chess960
Keep the isChess960 flag inside Position so that is copied with the Position, but esplicitly highlight the fact that a FEN string has not enough information to detect Chess960 in general case. To do this add a boolean argument isChess960 to from_fen() function so to self document this shortcoming of FEN notation. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -63,7 +63,7 @@ namespace {
|
||||
|
||||
bool execute_uci_command(const string& cmd) {
|
||||
|
||||
static Position pos(StartPositionFEN, 0); // The root position
|
||||
static Position pos(StartPositionFEN, false, 0); // The root position
|
||||
UCIParser up(cmd);
|
||||
string token;
|
||||
|
||||
@@ -84,7 +84,7 @@ bool execute_uci_command(const string& cmd) {
|
||||
cout << "uciok" << endl;
|
||||
}
|
||||
else if (token == "ucinewgame")
|
||||
pos.from_fen(StartPositionFEN);
|
||||
pos.from_fen(StartPositionFEN, false);
|
||||
|
||||
else if (token == "isready")
|
||||
cout << "readyok" << endl;
|
||||
@@ -147,7 +147,7 @@ namespace {
|
||||
|
||||
if (token == "startpos")
|
||||
{
|
||||
pos.from_fen(StartPositionFEN);
|
||||
pos.from_fen(StartPositionFEN, false);
|
||||
if (!(up >> token))
|
||||
return;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ namespace {
|
||||
fen += token;
|
||||
fen += ' ';
|
||||
}
|
||||
pos.from_fen(fen);
|
||||
pos.from_fen(fen, Options["UCI_Chess960"].value<bool>());
|
||||
}
|
||||
|
||||
if (token != "moves")
|
||||
|
||||
Reference in New Issue
Block a user