// Bonus for outpost squares
bb = OutpostRanks & ~pe->pawn_attacks_span(Them);
if (bb & s)
- score += Outpost[Pt == BISHOP][!!(attackedBy[Us][PAWN] & s)] * 2;
+ score += Outpost[Pt == BISHOP][bool(attackedBy[Us][PAWN] & s)] * 2;
else
{
bb &= b & ~pos.pieces(Us);
if (bb)
- score += Outpost[Pt == BISHOP][!!(attackedBy[Us][PAWN] & bb)];
+ score += Outpost[Pt == BISHOP][bool(attackedBy[Us][PAWN] & bb)];
}
// Bonus when behind a pawn
// Bonus when on an open or semi-open file
if (pe->semiopen_file(Us, file_of(s)))
- score += RookOnFile[!!pe->semiopen_file(Them, file_of(s))];
+ score += RookOnFile[bool(pe->semiopen_file(Them, file_of(s)))];
// Penalty when trapped by the king, even more if the king cannot castle
else if (mob <= 3)
kingDanger = kingAttackersCount[Them] * kingAttackersWeight[Them]
+ 102 * kingAdjacentZoneAttacksCount[Them]
+ 191 * popcount(kingRing[Us] & weak)
- + 143 * !!pos.pinned_pieces(Us)
+ + 143 * bool(pos.pinned_pieces(Us))
- 848 * !pos.count<QUEEN>(Them)
- 9 * mg_value(score) / 8
+ 40;
// Score this pawn
if (supported | phalanx)
- score += Connected[opposed][!!phalanx][popcount(supported)][relative_rank(Us, s)];
+ score += Connected[opposed][bool(phalanx)][popcount(supported)][relative_rank(Us, s)];
else if (!neighbours)
score -= Isolated, e->weakUnopposed[Us] += !opposed;
}
int pawns_on_same_color_squares(Color c, Square s) const {
- return pawnsOnSquares[c][!!(DarkSquares & s)];
+ return pawnsOnSquares[c][bool(DarkSquares & s)];
}
template<Color Us>
const bool PvNode = NT == PV;
- assert(InCheck == !!pos.checkers());
+ assert(InCheck == bool(pos.checkers()));
assert(alpha >= -VALUE_INFINITE && alpha < beta && beta <= VALUE_INFINITE);
assert(PvNode || (alpha == beta - 1));
assert(depth <= DEPTH_ZERO);