mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Simplify Safe Checks
STC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 11796 W: 2211 L: 2074 D: 7511 LTC: LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 14324 W: 1935 L: 1806 D: 10583 Bench: 8075202 Resolves #600
This commit is contained in:
parent
647402ff79
commit
04be84e0e2
1 changed files with 8 additions and 24 deletions
|
@ -424,36 +424,20 @@ namespace {
|
||||||
b2 = pos.attacks_from<BISHOP>(ksq) & safe;
|
b2 = pos.attacks_from<BISHOP>(ksq) & safe;
|
||||||
|
|
||||||
// Enemy queen safe checks
|
// Enemy queen safe checks
|
||||||
b = (b1 | b2) & ei.attackedBy[Them][QUEEN];
|
if ((b1 | b2) & ei.attackedBy[Them][QUEEN])
|
||||||
if (b)
|
attackUnits += QueenCheck, score -= Checked;
|
||||||
{
|
|
||||||
attackUnits += QueenCheck * popcount<Max15>(b);
|
|
||||||
score -= Checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enemy rooks safe checks
|
// Enemy rooks safe checks
|
||||||
b = b1 & ei.attackedBy[Them][ROOK];
|
if (b1 & ei.attackedBy[Them][ROOK])
|
||||||
if (b)
|
attackUnits += RookCheck, score -= Checked;
|
||||||
{
|
|
||||||
attackUnits += RookCheck * popcount<Max15>(b);
|
|
||||||
score -= Checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enemy bishops safe checks
|
// Enemy bishops safe checks
|
||||||
b = b2 & ei.attackedBy[Them][BISHOP];
|
if (b2 & ei.attackedBy[Them][BISHOP])
|
||||||
if (b)
|
attackUnits += BishopCheck, score -= Checked;
|
||||||
{
|
|
||||||
attackUnits += BishopCheck * popcount<Max15>(b);
|
|
||||||
score -= Checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Enemy knights safe checks
|
// Enemy knights safe checks
|
||||||
b = pos.attacks_from<KNIGHT>(ksq) & ei.attackedBy[Them][KNIGHT] & safe;
|
if (pos.attacks_from<KNIGHT>(ksq) & ei.attackedBy[Them][KNIGHT] & safe)
|
||||||
if (b)
|
attackUnits += KnightCheck, score -= Checked;
|
||||||
{
|
|
||||||
attackUnits += KnightCheck * popcount<Max15>(b);
|
|
||||||
score -= Checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finally, extract the king danger score from the KingDanger[]
|
// Finally, extract the king danger score from the KingDanger[]
|
||||||
// array and subtract the score from the evaluation.
|
// array and subtract the score from the evaluation.
|
||||||
|
|
Loading…
Add table
Reference in a new issue