assert(b);
if (!more_than_one(b) && (b & pos.pieces(Them)))
- score += ThreatBonus[Piece][type_of(pos.piece_on(first_1(b)))];
+ score += ThreatBonus[Piece][type_of(pos.piece_on(lsb(b)))];
}
// Decrease score if we are attacked by an enemy pawn. Remaining part
return SCORE_ZERO;
do {
- Square s = pop_1st_bit(&b);
+ Square s = pop_lsb(&b);
assert(pos.pawn_is_passed(Us, s));
while (b)
{
- s = pop_1st_bit(&b);
+ s = pop_lsb(&b);
queeningSquare = relative_square(c, file_of(s) | RANK_8);
queeningPath = forward_bb(c, s);
while (b)
{
- s = pop_1st_bit(&b);
+ s = pop_lsb(&b);
// Compute plies from queening
queeningSquare = relative_square(loserSide, file_of(s) | RANK_8);
while (b)
{
- s = pop_1st_bit(&b);
+ s = pop_lsb(&b);
sacptg = blockersCount = 0;
minKingDist = kingptg = 256;
// How many plies does it take to remove all the blocking pawns?
while (blockers)
{
- blockSq = pop_1st_bit(&blockers);
+ blockSq = pop_lsb(&blockers);
movesToGo = 256;
// Check pawns that can give support to overcome obstacle, for instance
while (b2) // This while-loop could be replaced with LSB/MSB (depending on color)
{
- d = square_distance(blockSq, pop_1st_bit(&b2)) - 2;
+ d = square_distance(blockSq, pop_lsb(&b2)) - 2;
movesToGo = std::min(movesToGo, d);
}
}
while (b2) // This while-loop could be replaced with LSB/MSB (depending on color)
{
- d = square_distance(blockSq, pop_1st_bit(&b2)) - 2;
+ d = square_distance(blockSq, pop_lsb(&b2)) - 2;
movesToGo = std::min(movesToGo, d);
}