1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Simplify backward pawn definition

Make use of 'lever' attribute

No functional change

Resolves #234
This commit is contained in:
Alain SAVARD 2015-01-26 11:05:53 -05:00 committed by Joona Kiiski
parent 7837fb2aca
commit 8aa8608c2a

View file

@ -144,12 +144,11 @@ namespace {
lever = theirPawns & pawnAttacksBB[s]; lever = theirPawns & pawnAttacksBB[s];
// Test for backward pawn. // Test for backward pawn.
// If the pawn is passed, isolated, or connected it cannot be // If the pawn is passed, isolated, connected or a lever it cannot be
// backward. If there are friendly pawns behind on adjacent files // backward. If there are friendly pawns behind on adjacent files
// or if it can capture an enemy pawn it cannot be backward either. // it cannot be backward either.
if ( (passed | isolated | connected) if ( (passed | isolated | connected | lever)
|| (ourPawns & pawn_attack_span(Them, s)) || (ourPawns & pawn_attack_span(Them, s)))
|| (pos.attacks_from<PAWN>(s, Us) & theirPawns))
backward = false; backward = false;
else else
{ {