void uci_main_loop() {
- RootPosition.from_fen(StartPosition);
+ RootPosition.from_fen(StartPositionFEN);
string command;
do {
else if (token == "ucinewgame")
{
push_button("New Game");
- Position::init_piece_square_tables();
- RootPosition.from_fen(StartPosition);
+ RootPosition.from_fen(StartPositionFEN);
}
else if (token == "isready")
cout << "readyok" << endl;
else if (token == "eval")
{
EvalInfo ei;
- cout << "Incremental mg: " << mg_value(RootPosition.value())
+ cout << "Incremental mg: " << mg_value(RootPosition.value())
<< "\nIncremental eg: " << eg_value(RootPosition.value())
- << "\nFull eval: " << evaluate(RootPosition, ei) << endl;
+ << "\nFull eval: " << evaluate(RootPosition, ei) << endl;
}
else if (token == "key")
cout << "key: " << hex << RootPosition.get_key()
return;
if (token == "startpos")
- RootPosition.from_fen(StartPosition);
+ RootPosition.from_fen(StartPositionFEN);
else if (token == "fen")
{
string fen;
move = move_from_string(RootPosition, token);
RootPosition.do_move(move, st);
if (RootPosition.rule_50_counter() == 0)
- RootPosition.reset_ply();
+ RootPosition.reset_game_ply();
+
+ RootPosition.inc_startpos_ply_counter(); //FIXME: make from_fen to support this and rule50
}
// Our StateInfo st is about going out of scope so copy
- // its content inside RootPosition before they disappear.
+ // its content inside RootPosition before it disappears.
RootPosition.detach();
}
}
assert(RootPosition.is_ok());
- return think(RootPosition, infinite, ponder, RootPosition.side_to_move(),
- time, inc, movesToGo, depth, nodes, moveTime, searchMoves);
+ return think(RootPosition, infinite, ponder, time, inc, movesToGo,
+ depth, nodes, moveTime, searchMoves);
}
void perft(UCIInputParser& uip) {
tm = get_system_time();
- n = perft(pos, depth * OnePly);
+ n = perft(pos, depth * ONE_PLY);
tm = get_system_time() - tm;
std::cout << "\nNodes " << n