Better document how history works

Both with added comment and changing the API to
reflect that only destination square and moved piece
is important for history.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2009-05-15 16:42:30 +02:00
parent 8df816f869
commit 436fa5c8fa
4 changed files with 50 additions and 44 deletions

View File

@@ -264,7 +264,7 @@ void MovePicker::score_noncaptures() {
else if (m == killer2)
hs = HistoryMax + 1;
else
hs = H.move_ordering_score(pos.piece_on(move_from(m)), m);
hs = H.move_ordering_score(pos.piece_on(move_from(m)), move_to(m));
// Ensure history is always preferred to pst
if (hs > 0)
@@ -287,7 +287,7 @@ void MovePicker::score_evasions() {
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);
moves[i].score = H.move_ordering_score(pos.piece_on(move_from(m)), move_to(m));
}
}