- const Score KingOnPawnOne = S(0 , 64);
- const Score KingOnPawnMany = S(0 ,128);
+ const Score KingOnOne = S(2 , 58);
+ const Score KingOnMany = S(6 ,125);
const Score RookOnPawn = S(10, 28);
const Score RookOpenFile = S(43, 21);
const Score RookSemiOpenFile = S(19, 10);
const Score RookOnPawn = S(10, 28);
const Score RookOpenFile = S(43, 21);
const Score RookSemiOpenFile = S(19, 10);
ei.attackedBy[Us][ALL_PIECES] = ei.attackedBy[Us][PAWN] = ei.pi->pawn_attacks(Us);
// Init king safety tables only if we are going to use them
ei.attackedBy[Us][ALL_PIECES] = ei.attackedBy[Us][PAWN] = ei.pi->pawn_attacks(Us);
// Init king safety tables only if we are going to use them
attackUnits = std::min(20, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2)
+ 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount<Max15>(undefended))
+ 2 * (ei.pinnedPieces[Us] != 0)
attackUnits = std::min(20, (ei.kingAttackersCount[Them] * ei.kingAttackersWeight[Them]) / 2)
+ 3 * (ei.kingAdjacentZoneAttacksCount[Them] + popcount<Max15>(undefended))
+ 2 * (ei.pinnedPieces[Us] != 0)
// Analyse the enemy's safe queen contact checks. Firstly, find the
// undefended squares around the king that are attacked by the enemy's
// Analyse the enemy's safe queen contact checks. Firstly, find the
// undefended squares around the king that are attacked by the enemy's
score += Threat[Minor][type_of(pos.piece_on(lsb(protectedEnemies)))];
// Enemies not defended by a pawn and under our attack
score += Threat[Minor][type_of(pos.piece_on(lsb(protectedEnemies)))];
// Enemies not defended by a pawn and under our attack
- // evaluate_unstoppable_pawns() scores the most advanced among the passed and
- // candidate pawns. In case both players have no pieces but pawns, this is
- // somewhat related to the possibility that pawns are unstoppable.
+ // evaluate_unstoppable_pawns() scores the most advanced passed pawn. In case
+ // both players have no pieces but pawns, this is somewhat related to the
+ // possibility that pawns are unstoppable.
// If we have a specialized evaluation function for the current material
// configuration, call it and return.
if (ei.mi->specialized_eval_exists())
// If we have a specialized evaluation function for the current material
// configuration, call it and return.
if (ei.mi->specialized_eval_exists())
// Probe the pawn hash table
ei.pi = Pawns::probe(pos, thisThread->pawnsTable);
// Probe the pawn hash table
ei.pi = Pawns::probe(pos, thisThread->pawnsTable);
/// of the position always from the point of view of the side to move.
Value evaluate(const Position& pos) {
/// of the position always from the point of view of the side to move.
Value evaluate(const Position& pos) {