mirror of
https://github.com/sockspls/badfish
synced 2025-05-03 10:09:35 +00:00
Rearrange evaluation constants definitions
Make them more uniform and consistent. No functional change. Conflicts: src/evaluate.cpp
This commit is contained in:
parent
4d0a6c5a6f
commit
b652720903
1 changed files with 16 additions and 17 deletions
|
@ -150,25 +150,24 @@ namespace {
|
||||||
S(0, 0), S(0, 0), S(80, 119), S(80, 119), S(117, 199), S(127, 218)
|
S(0, 0), S(0, 0), S(80, 119), S(80, 119), S(117, 199), S(127, 218)
|
||||||
};
|
};
|
||||||
|
|
||||||
// Hanging contains a bonus for each enemy hanging piece
|
// Assorted bonuses and penalties used by evaluation
|
||||||
|
const Score KingOnPawnOne = S(0 , 64);
|
||||||
|
const Score KingOnPawnMany = S(0 ,128);
|
||||||
|
const Score RookOnPawn = S(10, 28);
|
||||||
|
const Score RookOpenFile = S(43, 21);
|
||||||
|
const Score RookSemiOpenFile = S(19, 10);
|
||||||
|
const Score BishopPawns = S( 8, 12);
|
||||||
|
const Score MinorBehindPawn = S(16, 0);
|
||||||
|
const Score TrappedRook = S(92, 0);
|
||||||
|
const Score Unstoppable = S( 0, 20);
|
||||||
const Score Hanging = S(23, 20);
|
const Score Hanging = S(23, 20);
|
||||||
const Score KingPawnThreatOne = S(0, 64);
|
|
||||||
const Score KingPawnThreatMany = S(0, 128);
|
|
||||||
|
|
||||||
#undef S
|
|
||||||
|
|
||||||
const Score RookOnPawn = make_score(10, 28);
|
|
||||||
const Score RookOpenFile = make_score(43, 21);
|
|
||||||
const Score RookSemiopenFile = make_score(19, 10);
|
|
||||||
const Score BishopPawns = make_score( 8, 12);
|
|
||||||
const Score MinorBehindPawn = make_score(16, 0);
|
|
||||||
const Score TrappedRook = make_score(92, 0);
|
|
||||||
const Score Unstoppable = make_score( 0, 20);
|
|
||||||
|
|
||||||
// Penalty for a bishop on a1/h1 (a8/h8 for black) which is trapped by
|
// Penalty for a bishop on a1/h1 (a8/h8 for black) which is trapped by
|
||||||
// a friendly pawn on b2/g2 (b7/g7 for black). This can obviously only
|
// a friendly pawn on b2/g2 (b7/g7 for black). This can obviously only
|
||||||
// happen in Chess960 games.
|
// happen in Chess960 games.
|
||||||
const Score TrappedBishopA1H1 = make_score(50, 50);
|
const Score TrappedBishopA1H1 = S(50, 50);
|
||||||
|
|
||||||
|
#undef S
|
||||||
|
|
||||||
// SpaceMask[Color] contains the area of the board which is considered
|
// SpaceMask[Color] contains the area of the board which is considered
|
||||||
// by the space evaluation. In the middlegame, each side is given a bonus
|
// by the space evaluation. In the middlegame, each side is given a bonus
|
||||||
|
@ -340,7 +339,7 @@ namespace {
|
||||||
|
|
||||||
// Give a bonus for a rook on a open or semi-open file
|
// Give a bonus for a rook on a open or semi-open file
|
||||||
if (ei.pi->semiopen_file(Us, file_of(s)))
|
if (ei.pi->semiopen_file(Us, file_of(s)))
|
||||||
score += ei.pi->semiopen_file(Them, file_of(s)) ? RookOpenFile : RookSemiopenFile;
|
score += ei.pi->semiopen_file(Them, file_of(s)) ? RookOpenFile : RookSemiOpenFile;
|
||||||
|
|
||||||
if (mob > 3 || ei.pi->semiopen_file(Us, file_of(s)))
|
if (mob > 3 || ei.pi->semiopen_file(Us, file_of(s)))
|
||||||
continue;
|
continue;
|
||||||
|
@ -532,7 +531,7 @@ namespace {
|
||||||
|
|
||||||
b = weakEnemies & pos.pieces(Them, PAWN) & ei.attackedBy[Us][KING];
|
b = weakEnemies & pos.pieces(Them, PAWN) & ei.attackedBy[Us][KING];
|
||||||
if (b)
|
if (b)
|
||||||
score += more_than_one(b) ? KingPawnThreatMany : KingPawnThreatOne;
|
score += more_than_one(b) ? KingOnPawnMany : KingOnPawnOne;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Trace)
|
if (Trace)
|
||||||
|
|
Loading…
Add table
Reference in a new issue