mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 00:33:09 +00:00
Clean-up some shifting in space calculation (#1955)
No functional change.
This commit is contained in:
parent
3acacf8471
commit
691a287bfe
1 changed files with 4 additions and 3 deletions
|
@ -702,6 +702,7 @@ namespace {
|
||||||
return SCORE_ZERO;
|
return SCORE_ZERO;
|
||||||
|
|
||||||
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
|
constexpr Color Them = (Us == WHITE ? BLACK : WHITE);
|
||||||
|
constexpr Direction Down = (Us == WHITE ? SOUTH : NORTH);
|
||||||
constexpr Bitboard SpaceMask =
|
constexpr Bitboard SpaceMask =
|
||||||
Us == WHITE ? CenterFiles & (Rank2BB | Rank3BB | Rank4BB)
|
Us == WHITE ? CenterFiles & (Rank2BB | Rank3BB | Rank4BB)
|
||||||
: CenterFiles & (Rank7BB | Rank6BB | Rank5BB);
|
: CenterFiles & (Rank7BB | Rank6BB | Rank5BB);
|
||||||
|
@ -713,8 +714,8 @@ namespace {
|
||||||
|
|
||||||
// Find all squares which are at most three squares behind some friendly pawn
|
// Find all squares which are at most three squares behind some friendly pawn
|
||||||
Bitboard behind = pos.pieces(Us, PAWN);
|
Bitboard behind = pos.pieces(Us, PAWN);
|
||||||
behind |= (Us == WHITE ? behind >> 8 : behind << 8);
|
behind |= shift<Down>(behind);
|
||||||
behind |= (Us == WHITE ? behind >> 16 : behind << 16);
|
behind |= shift<Down>(shift<Down>(behind));
|
||||||
|
|
||||||
int bonus = popcount(safe) + popcount(behind & safe);
|
int bonus = popcount(safe) + popcount(behind & safe);
|
||||||
int weight = pos.count<ALL_PIECES>(Us)
|
int weight = pos.count<ALL_PIECES>(Us)
|
||||||
|
|
Loading…
Add table
Reference in a new issue