X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fuci.cpp;h=876bb1d90718bfc6870ea302ed2af02b6b93a704;hp=cfd112172bf11fe048c4a78447c43888006ca10b;hb=94dd204c3b10ebe0e6c8df5d7c98de5ba4906cad;hpb=5ab55827b84f1aef79478ec9b030330973036bda diff --git a/src/uci.cpp b/src/uci.cpp index cfd11217..876bb1d9 100644 --- a/src/uci.cpp +++ b/src/uci.cpp @@ -157,6 +157,7 @@ void UCI::loop(int argc, char* argv[]) { istringstream is(cmd); + token.clear(); // getline() could return empty or blank line is >> skipws >> token; if (token == "quit" || token == "stop" || token == "ponderhit") @@ -203,7 +204,7 @@ void UCI::loop(int argc, char* argv[]) { else if (token == "setoption") setoption(is); else if (token == "flip") pos.flip(); else if (token == "bench") benchmark(pos, is); - else if (token == "d") sync_cout << pos.pretty() << sync_endl; + else if (token == "d") sync_cout << pos << sync_endl; else if (token == "isready") sync_cout << "readyok" << sync_endl; else if (token == "eval") sync_cout << Eval::trace(pos) << sync_endl; else @@ -226,7 +227,7 @@ string UCI::format_value(Value v, Value alpha, Value beta) { stringstream ss; - if (abs(v) < VALUE_MATE_IN_MAX_PLY) + if (abs(v) < VALUE_MATE - MAX_PLY) ss << "cp " << v * 100 / PawnValueEg; else ss << "mate " << (v > 0 ? VALUE_MATE - v + 1 : -VALUE_MATE - v) / 2;