From b3744eb4d0df5b9a2a78ef7de236b9a7aff7b6ca Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Wed, 15 Oct 2008 20:45:29 +0200 Subject: [PATCH] Always add psqt scoring When there is also history, history is always preferred. Signed-off-by: Marco Costalba --- src/movepick.cpp | 26 ++++++-------------------- src/movepick.h | 1 - 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index 1a00367b..361644af 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -247,35 +247,21 @@ void MovePicker::score_captures() { void MovePicker::score_noncaptures() { - All_zero = true; for (int i = 0; i < numOfMoves; i++) { Move m = moves[i].move; if (m == killer1) - { moves[i].score = HistoryMax + 2; - All_zero = false; - } else if (m == killer2) - { moves[i].score = HistoryMax + 1; - All_zero = false; - } else - { 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() { @@ -359,7 +345,7 @@ Move MovePicker::pick_move_from_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) { diff --git a/src/movepick.h b/src/movepick.h index b60dfe06..df2012fe 100644 --- a/src/movepick.h +++ b/src/movepick.h @@ -87,7 +87,6 @@ private: int numOfMoves, numOfBadCaptures; int movesPicked, badCapturesPicked; bool finished; - bool All_zero; }; -- 2.39.2