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

@@ -2332,7 +2332,7 @@ namespace {
return false;
// Case 4: Don't prune moves with good history.
if (!H.ok_to_prune(pos.piece_on(move_from(m)), m, d))
if (!H.ok_to_prune(pos.piece_on(mfrom), mto, d))
return false;
// Case 5: If the moving piece in the threatened move is a slider, don't
@@ -2379,13 +2379,13 @@ namespace {
void update_history(const Position& pos, Move m, Depth depth,
Move movesSearched[], int moveCount) {
H.success(pos.piece_on(move_from(m)), m, depth);
H.success(pos.piece_on(move_from(m)), move_to(m), depth);
for (int i = 0; i < moveCount - 1; i++)
{
assert(m != movesSearched[i]);
if (ok_to_history(pos, movesSearched[i]))
H.failure(pos.piece_on(move_from(movesSearched[i])), movesSearched[i]);
H.failure(pos.piece_on(move_from(movesSearched[i])), move_to(movesSearched[i]));
}
}