opposed = theirPawns & forward_file_bb(Us, s);
blocked = theirPawns & (s + Up);
stoppers = theirPawns & passed_pawn_span(Us, s);
- lever = theirPawns & PawnAttacks[Us][s];
- leverPush = theirPawns & PawnAttacks[Us][s + Up];
+ lever = theirPawns & pawn_attacks_bb(Us, s);
+ leverPush = theirPawns & pawn_attacks_bb(Us, s + Up);
doubled = ourPawns & (s - Up);
neighbours = ourPawns & adjacent_files_bb(s);
phalanx = neighbours & rank_bb(s);
else if (!neighbours)
{
- score -= Isolated
- + WeakUnopposed * !opposed;
-
- if ( (ourPawns & forward_file_bb(Them, s))
- && popcount(opposed) == 1
+ if ( opposed
+ && (ourPawns & forward_file_bb(Them, s))
&& !(theirPawns & adjacent_files_bb(s)))
score -= Doubled;
+ else
+ score -= Isolated
+ + WeakUnopposed * !opposed;
}
else if (backward)
Bitboard pawns = pos.pieces(Us, PAWN);
int minPawnDist = 6;
- if (pawns & PseudoAttacks[KING][ksq])
+ if (pawns & attacks_bb<KING>(ksq))
minPawnDist = 1;
else while (pawns)
minPawnDist = std::min(minPawnDist, distance(ksq, pop_lsb(&pawns)));