From 3e275680d5e9a2b335cddd4bd96bed494987933d Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Sun, 2 Nov 2008 08:47:27 +0100 Subject: [PATCH] Use MVV/LVA in score_evasions() Signed-off-by: Marco Costalba --- src/movepick.cpp | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index c71572e7..59855dba 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -251,21 +251,26 @@ void MovePicker::score_noncaptures() { } } -void MovePicker::score_evasions() { - - for (int i = 0; i < numOfMoves; i++) - { - Move m = moves[i].move; - if (m == ttMove) - moves[i].score = 2*HistoryMax; - else if (!pos.square_is_empty(move_to(m))) - { - int seeScore = pos.see(m); - moves[i].score = (seeScore >= 0)? seeScore + HistoryMax : seeScore; - } else - moves[i].score = H.move_ordering_score(pos.piece_on(move_from(m)), m); - } - // FIXME try psqt also here +void MovePicker::score_evasions() { + + Move m; + int hs; + + // Use MVV/LVA ordering + for (int i = 0; i < numOfMoves; i++) + { + m = moves[i].move; + + if (m == ttMove) + hs = 2*HistoryMax; + else if (!pos.square_is_empty(move_to(m))) + hs = int(pos.midgame_value_of_piece_on(move_to(m))) + -int(pos.type_of_piece_on(move_from(m))) + HistoryMax; + else + hs = H.move_ordering_score(pos.piece_on(move_from(m)), m); + + moves[i].score = hs; + } } void MovePicker::score_qcaptures() { -- 2.39.2