+ // qsearch_scoring() scores each move of a list using a qsearch() evaluation,
+ // it is used in RootMoveList to get an initial scoring.
+ void qsearch_scoring(Position& pos, MoveStack* mlist, MoveStack* last) {
+
+ SearchStack ss[PLY_MAX_PLUS_2];
+ StateInfo st;
+
+ memset(ss, 0, 4 * sizeof(SearchStack));
+ ss[0].eval = ss[0].evalMargin = VALUE_NONE;
+
+ for (MoveStack* cur = mlist; cur != last; cur++)
+ {
+ ss[0].currentMove = cur->move;
+ pos.do_move(cur->move, st);
+ cur->score = -qsearch<PV>(pos, ss+1, -VALUE_INFINITE, VALUE_INFINITE, DEPTH_ZERO, 1);
+ pos.undo_move(cur->move);
+ }
+ }
+
+