Value mgValue[2] = {Value(0), Value(0)};
Value egValue[2] = {Value(0), Value(0)};
+ // Calculate pawn attacks
+ pi->pawnAttacks[WHITE] = ((pos.pieces(PAWN, WHITE) << 9) & ~FileABB) | ((pos.pieces(PAWN, WHITE) << 7) & ~FileHBB);
+ pi->pawnAttacks[BLACK] = ((pos.pieces(PAWN, BLACK) >> 7) & ~FileABB) | ((pos.pieces(PAWN, BLACK) >> 9) & ~FileHBB);
+
// Loop through the pawns for both colors
for (Color us = WHITE; us <= BLACK; us++)
{
// it cannot be backward. If can capture an enemy pawn or if
// there are friendly pawns behind on neighboring files it cannot
// be backward either.
+
bool backward;
- if ( passed
- || isolated
- || chain
- || (pos.attacks_from<PAWN>(s, us) & theirPawns)
- || (ourPawns & behind_bb(us, r) & neighboring_files_bb(f)))
+ if ( (passed | isolated | chain)
+ || (ourPawns & behind_bb(us, r) & neighboring_files_bb(f))
+ || (pos.attacks_from<PAWN>(s, us) & theirPawns))
backward = false;
else
{