mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Sync with master
bench: 8285241
This commit is contained in:
commit
0da7295795
2 changed files with 9 additions and 11 deletions
|
@ -155,7 +155,7 @@ namespace {
|
||||||
// ThreatenedByPawn[PieceType] contains a penalty according to which piece
|
// ThreatenedByPawn[PieceType] contains a penalty according to which piece
|
||||||
// type is attacked by an enemy pawn.
|
// type is attacked by an enemy pawn.
|
||||||
const Score ThreatenedByPawn[PIECE_TYPE_NB] = {
|
const Score ThreatenedByPawn[PIECE_TYPE_NB] = {
|
||||||
S(0, 0), S(0, 0), S(87, 118), S(84, 122), S(114, 203), S(121, 217)
|
S(0, 0), S(0, 0), S(107, 138), S(84, 122), S(114, 203), S(121, 217)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Assorted bonuses and penalties used by evaluation
|
// Assorted bonuses and penalties used by evaluation
|
||||||
|
|
|
@ -110,9 +110,9 @@ namespace {
|
||||||
const Square Right = (Us == WHITE ? DELTA_NE : DELTA_SW);
|
const Square Right = (Us == WHITE ? DELTA_NE : DELTA_SW);
|
||||||
const Square Left = (Us == WHITE ? DELTA_NW : DELTA_SE);
|
const Square Left = (Us == WHITE ? DELTA_NW : DELTA_SE);
|
||||||
|
|
||||||
Bitboard b, p, doubled, connected, supported;
|
Bitboard b, neighbours, doubled, connected, supported, phalanx;
|
||||||
Square s;
|
Square s;
|
||||||
bool passed, isolated, opposed, phalanx, backward, lever;
|
bool passed, isolated, opposed, backward, lever;
|
||||||
Score score = SCORE_ZERO;
|
Score score = SCORE_ZERO;
|
||||||
const Square* pl = pos.list<PAWN>(Us);
|
const Square* pl = pos.list<PAWN>(Us);
|
||||||
const Bitboard* pawnAttacksBB = StepAttacksBB[make_piece(Us, PAWN)];
|
const Bitboard* pawnAttacksBB = StepAttacksBB[make_piece(Us, PAWN)];
|
||||||
|
@ -137,18 +137,16 @@ namespace {
|
||||||
// This file cannot be semi-open
|
// This file cannot be semi-open
|
||||||
e->semiopenFiles[Us] &= ~(1 << f);
|
e->semiopenFiles[Us] &= ~(1 << f);
|
||||||
|
|
||||||
// Previous rank
|
|
||||||
p = rank_bb(s - Up);
|
|
||||||
|
|
||||||
// Flag the pawn
|
// Flag the pawn
|
||||||
connected = ourPawns & adjacent_files_bb(f) & (rank_bb(s) | p);
|
neighbours = ourPawns & adjacent_files_bb(f);
|
||||||
phalanx = connected & rank_bb(s);
|
|
||||||
supported = connected & p;
|
|
||||||
isolated = !(ourPawns & adjacent_files_bb(f));
|
|
||||||
doubled = ourPawns & forward_bb(Us, s);
|
doubled = ourPawns & forward_bb(Us, s);
|
||||||
opposed = theirPawns & forward_bb(Us, s);
|
opposed = theirPawns & forward_bb(Us, s);
|
||||||
passed = !(theirPawns & passed_pawn_mask(Us, s));
|
passed = !(theirPawns & passed_pawn_mask(Us, s));
|
||||||
lever = theirPawns & pawnAttacksBB[s];
|
lever = theirPawns & pawnAttacksBB[s];
|
||||||
|
phalanx = neighbours & rank_bb(s);
|
||||||
|
supported = neighbours & rank_bb(s - Up);
|
||||||
|
connected = supported | phalanx;
|
||||||
|
isolated = !neighbours;
|
||||||
|
|
||||||
// Test for backward pawn.
|
// Test for backward pawn.
|
||||||
// If the pawn is passed, isolated, lever or connected it cannot be
|
// If the pawn is passed, isolated, lever or connected it cannot be
|
||||||
|
@ -193,7 +191,7 @@ namespace {
|
||||||
score -= Backward[opposed][f];
|
score -= Backward[opposed][f];
|
||||||
|
|
||||||
if (connected)
|
if (connected)
|
||||||
score += Connected[opposed][phalanx][more_than_one(supported)][relative_rank(Us, s)];
|
score += Connected[opposed][!!phalanx][more_than_one(supported)][relative_rank(Us, s)];
|
||||||
|
|
||||||
if (lever)
|
if (lever)
|
||||||
score += Lever[relative_rank(Us, s)];
|
score += Lever[relative_rank(Us, s)];
|
||||||
|
|
Loading…
Add table
Reference in a new issue