When there is also history, history is always
preferred.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
void MovePicker::score_noncaptures() {
void MovePicker::score_noncaptures() {
for (int i = 0; i < numOfMoves; i++)
{
Move m = moves[i].move;
if (m == killer1)
for (int i = 0; i < numOfMoves; i++)
{
Move m = moves[i].move;
if (m == killer1)
moves[i].score = HistoryMax + 2;
moves[i].score = HistoryMax + 2;
moves[i].score = HistoryMax + 1;
moves[i].score = HistoryMax + 1;
moves[i].score = H.move_ordering_score(pos->piece_on(move_from(m)), m);
moves[i].score = H.move_ordering_score(pos->piece_on(move_from(m)), m);
- if (All_zero && moves[i].score != 0)
- All_zero = false;
- }
+
+ if (moves[i].score > 0)
+ moves[i].score += 1000;
+
+ moves[i].score += pos->mg_pst_delta(moves[i].move);
- //if (!all_zero)
- // return;
-
- // If we don't have at least one history score then
- // try to order using psq tables difference between
- // from square and to square.
- //for (int i = 0; i < numOfMoves; i++)
- // moves[i].score = pos->mg_pst_delta(moves[i].move);
}
void MovePicker::score_evasions() {
}
void MovePicker::score_evasions() {
// the entire move list for the best move. If many moves have already
// been searched and it is not a PV node, we are probably failing low
// anyway, so we just pick the first move from the list.
// the entire move list for the best move. If many moves have already
// been searched and it is not a PV node, we are probably failing low
// anyway, so we just pick the first move from the list.
- if(!All_zero && (pvNode || movesPicked < 12)) {
+ if(pvNode || movesPicked < 12) {
bestIndex = -1;
for(int i = movesPicked; i < numOfMoves; i++)
if(moves[i].score > bestScore) {
bestIndex = -1;
for(int i = movesPicked; i < numOfMoves; i++)
if(moves[i].score > bestScore) {
int numOfMoves, numOfBadCaptures;
int movesPicked, badCapturesPicked;
bool finished;
int numOfMoves, numOfBadCaptures;
int movesPicked, badCapturesPicked;
bool finished;