]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Fix perft 1
[stockfish] / src / search.cpp
index 8410f73bbf8ee8ad49f45f1e1777cb200e745759..c7eb5f9a70f19d200f3cc291ea9fdd0fa852577b 100644 (file)
@@ -163,7 +163,7 @@ uint64_t Search::perft(Position& pos, Depth depth) {
   for (MoveList<LEGAL> it(pos); *it; ++it)
   {
       if (Root && depth <= ONE_PLY)
-          cnt = 1;
+          cnt = 1, nodes++;
       else
       {
           pos.do_move(*it, st, ci, pos.gives_check(*it, ci));
@@ -232,12 +232,9 @@ void Search::think() {
       Log log(Options["Search Log Filename"]);
       log << "Nodes: "          << RootPos.nodes_searched()
           << "\nNodes/second: " << RootPos.nodes_searched() * 1000 / elapsed
-          << "\nBest move: "    << move_to_san(RootPos, RootMoves[0].pv[0]);
-
-      StateInfo st;
-      RootPos.do_move(RootMoves[0].pv[0], st);
-      log << "\nPonder move: " << move_to_san(RootPos, RootMoves[0].pv[1]) << std::endl;
-      RootPos.undo_move(RootMoves[0].pv[0]);
+          << "\nBest move: "    << move_to_uci(RootMoves[0].pv[0], RootPos.is_chess960())
+          << "\nPonder move: "  << move_to_uci(RootMoves[0].pv[1], RootPos.is_chess960())
+          << std::endl;
   }
 
 finalize: