mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
Small rewrite of backward pawn test
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
b5178597bd
commit
95388a952b
1 changed files with 6 additions and 6 deletions
|
@ -214,7 +214,7 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
|
||||||
pi->qsStormValue[Us] += QStormTable[relative_square(Us, s)] + bonus;
|
pi->qsStormValue[Us] += QStormTable[relative_square(Us, s)] + bonus;
|
||||||
|
|
||||||
// Our rank plus previous one. Used for chain detection.
|
// Our rank plus previous one. Used for chain detection.
|
||||||
b = rank_bb(r) | rank_bb(r + (Us == WHITE ? -1 : 1));
|
b = rank_bb(r) | rank_bb(Us == WHITE ? r - 1 : r + 1);
|
||||||
|
|
||||||
// Passed, isolated, doubled or member of a pawn
|
// Passed, isolated, doubled or member of a pawn
|
||||||
// chain (but not the backward one) ?
|
// chain (but not the backward one) ?
|
||||||
|
@ -226,15 +226,15 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
|
||||||
|
|
||||||
// Test for backward pawn
|
// Test for backward pawn
|
||||||
//
|
//
|
||||||
|
backward = false;
|
||||||
|
|
||||||
// If the pawn is passed, isolated, or member of a pawn chain
|
// If the pawn is passed, isolated, or member of a pawn chain
|
||||||
// it cannot be backward. If can capture an enemy pawn or if
|
// it cannot be backward. If can capture an enemy pawn or if
|
||||||
// there are friendly pawns behind on neighboring files it cannot
|
// there are friendly pawns behind on neighboring files it cannot
|
||||||
// be backward either.
|
// be backward either.
|
||||||
if ( (passed | isolated | chain)
|
if ( !(passed | isolated | chain)
|
||||||
|| (ourPawns & attack_span_mask(opposite_color(Us), s))
|
&& !(ourPawns & attack_span_mask(opposite_color(Us), s))
|
||||||
|| (pos.attacks_from<PAWN>(s, Us) & theirPawns))
|
&& !(pos.attacks_from<PAWN>(s, Us) & theirPawns))
|
||||||
backward = false;
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// We now know that there are no friendly pawns beside or behind this
|
// We now know that there are no friendly pawns beside or behind this
|
||||||
// pawn on neighboring files. We now check whether the pawn is
|
// pawn on neighboring files. We now check whether the pawn is
|
||||||
|
|
Loading…
Add table
Reference in a new issue