mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 02:27:00 +08:00
King-pawn threat bonus for endgames.
STC: LLR: 2.95 (-2.94,2.94) [-1.50,4.50] Total: 10224 W: 1765 L: 1638 D: 6821 LTC: LLR: 2.96 (-2.94,2.94) [0.00,6.00] Total: 6923 W: 1027 L: 899 D: 4997 bench 7818100 Resolves #49
This commit is contained in:
committed by
Gary Linscott
parent
aa10d0aaa6
commit
2eec710318
@@ -152,6 +152,8 @@ namespace {
|
||||
|
||||
// Hanging contains a bonus for each enemy hanging piece
|
||||
const Score Hanging = S(23, 20);
|
||||
const Score KingPawnThreatOne = S(0, 64);
|
||||
const Score KingPawnThreatMany = S(0, 128);
|
||||
|
||||
#undef S
|
||||
|
||||
@@ -527,7 +529,11 @@ namespace {
|
||||
b = weakEnemies & ~ei.attackedBy[Them][ALL_PIECES];
|
||||
if (b)
|
||||
score += more_than_one(b) ? Hanging * popcount<Max15>(b) : Hanging;
|
||||
}
|
||||
|
||||
b = weakEnemies & pos.pieces(Them, PAWN) & ei.attackedBy[Us][KING];
|
||||
if (b)
|
||||
score += more_than_one(b) ? KingPawnThreatMany : KingPawnThreatOne;
|
||||
}
|
||||
|
||||
if (Trace)
|
||||
Tracing::terms[Us][Tracing::THREAT] = score;
|
||||
|
||||
Reference in New Issue
Block a user