void set_non_pv_scores(const Position& pos);
void sort() { insertion_sort<RootMove, Base::iterator>(begin(), end()); }
- void sort_multipv(int n) { insertion_sort<RootMove, Base::iterator>(begin(), begin() + n); }
+ void sort_multipv(int n) { insertion_sort<RootMove, Base::iterator>(begin(), begin() + n + 1); }
};
std::string name = Options["Search Log Filename"].value<std::string>();
LogFile.open(name.c_str(), std::ios::out | std::ios::app);
- LogFile << "Searching: " << pos.to_fen()
+ LogFile << "Searching: " << pos.to_fen(Options["UCI_Chess960"].value<bool>())
<< "\ninfinite: " << infinite
<< " ponder: " << ponder
<< " time: " << myTime
<< move_to_san(pos, ponderMove) // Works also with MOVE_NONE
<< endl;
+ // Return from think() with unchanged position
+ pos.undo_move(bestMove);
+
LogFile.close();
}
Iteration = 1;
// Send initial RootMoveList scoring (iteration 1)
- cout << set960(pos.is_chess960()) // Is enough to set once at the beginning
+ cout << set960(Options["UCI_Chess960"].value<bool>()) // Is enough to set once at the beginning
<< "info depth " << Iteration
<< "\n" << rml[0].pv_info_to_uci(pos, alpha, beta) << endl;
// Write PV lines to transposition table, in case the relevant entries
// have been overwritten during the search.
- for (int i = 0; i < MultiPV; i++)
+ for (int i = 0; i < Min(MultiPV, (int)rml.size()); i++)
rml[i].insert_pv_in_tt(pos);
return alpha;