#include <iostream>
#include <sstream>
#include <string>
+#include <vector>
#include "evaluate.h"
#include "misc.h"
// FEN string for the initial position
const string StartPositionFEN = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1";
+ // Keep track of position keys along the setup moves (from start position to the
+ // position just before to start searching). This is needed by draw detection.
+ std::vector<StateInfo> SetupState;
+
// UCIParser is a class for parsing UCI input. The class
// is actually a string stream built on a given input string.
typedef istringstream UCIParser;
}
else return;
+ SetupState.clear();
+
// Parse move list (if any)
while (up >> token && (m = move_from_uci(pos, token)) != MOVE_NONE)
- pos.do_setup_move(m);
+ {
+ SetupState.push_back(StateInfo());
+ pos.do_move(m, SetupState.back());
+ }
}