// Initialize score by reading the incrementally updated scores included
// in the position object (material + piece square tables).
score = pos.value();
// Initialize score by reading the incrementally updated scores included
// in the position object (material + piece square tables).
score = pos.value();
- Bitboard undefended = pos.pieces(Them) & ~ei.attackedBy[Them][0];
- const Bitboard undefendedMinors = undefended & (pos.pieces(BISHOP) | pos.pieces(KNIGHT));
-
+ undefended = pos.pieces(Them) & ~ei.attackedBy[Them][0];
+ undefendedMinors = undefended & (pos.pieces(BISHOP) | pos.pieces(KNIGHT));
+
- Bitboard weakEnemies = pos.pieces(Them)
- & ~ei.attackedBy[Them][PAWN]
- & ei.attackedBy[Us][0];
+ weakEnemies = pos.pieces(Them)
+ & ~ei.attackedBy[Them][PAWN]
+ & ei.attackedBy[Us][0];
+
attackUnits = std::min(25, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2)
+ 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount<Max15>(undefended))
+ InitKingDanger[relative_square(Us, ksq)]
attackUnits = std::min(25, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2)
+ 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount<Max15>(undefended))
+ InitKingDanger[relative_square(Us, ksq)]
// Analyse enemy's safe queen contact checks. First find undefended
// squares around the king attacked by enemy queen...
// Analyse enemy's safe queen contact checks. First find undefended
// squares around the king attacked by enemy queen...