Skip to content

Commit 288ae92

Browse files
authored
Merge pull request official-stockfish#329 from ianfab/atomic_ind2
Additional term for king danger in atomic chess
2 parents ac87d48 + 2cf9100 commit 288ae92

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/evaluate.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ namespace {
546546
const int RookCheck = 688;
547547
const int BishopCheck = 588;
548548
const int KnightCheck = 924;
549+
#ifdef ATOMIC
550+
const int IndirectKingAttack = 1000;
551+
#endif
549552

550553
#ifdef THREECHECK
551554
// In Q8 fixed point
@@ -883,7 +886,10 @@ namespace {
883886

884887
#ifdef ATOMIC
885888
if (pos.is_atomic())
889+
{
890+
kingDanger += IndirectKingAttack * popcount(pos.attacks_from<KING>(pos.square<KING>(Us)) & pos.pieces(Us) & ei.attackedBy[Them][ALL_PIECES]);
886891
score -= make_score(100, 100) * popcount(ei.attackedBy[Us][KING] & pos.pieces());
892+
}
887893
#endif
888894
// Transform the kingDanger units into a Score, and substract it from the evaluation
889895
if (kingDanger > 0)

0 commit comments

Comments
 (0)