Square s;
File f;
Rank r;
- int bonus, backwardWeight;
+ int bonus;
bool passed, isolated, doubled, opposed, chain, backward, candidate;
Score value = make_score(0, 0);
const Square* ptr = pos.piece_list_begin(Us, PAWN);
// Test for backward pawn
//
backward = false;
- backwardWeight = 6;
// If the pawn is passed, isolated, or member of a pawn chain
// it cannot be backward. If can capture an enemy pawn or if
// Note that we are sure to find something because pawn is not passed
// nor isolated, so loop is potentially infinite, but it isn't.
while (!(b & (ourPawns | theirPawns)))
- {
Us == WHITE ? b <<= 8 : b >>= 8;
- backwardWeight--;
- }
-
- assert(backwardWeight > 0);
// The friendly pawn needs to be at least two ranks closer than the enemy
// pawn in order to help the potentially backward pawn advance.
if (backward)
{
- value -= backwardWeight * BackwardPawnPenalty[f] / 4;
+ value -= BackwardPawnPenalty[f];
if (!opposed)
value -= BackwardPawnPenalty[f] / 2;
}