mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00: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:
parent
aa10d0aaa6
commit
2eec710318
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue