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

Rearrange pawn penalities arrays

A clean up that is also a prerequisite for next patches.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-10-09 13:20:49 +01:00
parent 7733dadfd7
commit a0474a72a6

View file

@ -40,23 +40,26 @@ namespace {
#define S(mg, eg) make_score(mg, eg) #define S(mg, eg) make_score(mg, eg)
// Doubled pawn penalty by file // Doubled pawn penalty by opposed flag and file
const Score DoubledPawnPenalty[8] = { const Score DoubledPawnPenalty[2][8] = {
S(13, 43), S(20, 48), S(23, 48), S(23, 48), { S(13, 43), S(20, 48), S(23, 48), S(23, 48),
S(23, 48), S(23, 48), S(20, 48), S(13, 43) S(23, 48), S(23, 48), S(20, 48), S(13, 43) },
}; { S(13, 43), S(20, 48), S(23, 48), S(23, 48),
S(23, 48), S(23, 48), S(20, 48), S(13, 43) }};
// Isolated pawn penalty by file // Isolated pawn penalty by opposed flag and file
const Score IsolatedPawnPenalty[8] = { const Score IsolatedPawnPenalty[2][8] = {
S(25, 30), S(36, 35), S(40, 35), S(40, 35), { S(37, 45), S(54, 52), S(60, 52), S(60, 52),
S(40, 35), S(40, 35), S(36, 35), S(25, 30) S(60, 52), S(60, 52), S(54, 52), S(37, 45) },
}; { S(25, 30), S(36, 35), S(40, 35), S(40, 35),
S(40, 35), S(40, 35), S(36, 35), S(25, 30) }};
// Backward pawn penalty by file // Backward pawn penalty by opposed flag and file
const Score BackwardPawnPenalty[8] = { const Score BackwardPawnPenalty[2][8] = {
S(20, 28), S(29, 31), S(33, 31), S(33, 31), { S(30, 42), S(43, 46), S(49, 46), S(49, 46),
S(33, 31), S(33, 31), S(29, 31), S(20, 28) S(49, 46), S(49, 46), S(43, 46), S(30, 42) },
}; { S(20, 28), S(29, 31), S(33, 31), S(33, 31),
S(33, 31), S(33, 31), S(29, 31), S(20, 28) }};
// Pawn chain membership bonus by file // Pawn chain membership bonus by file
const Score ChainBonus[8] = { const Score ChainBonus[8] = {
@ -223,20 +226,14 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
// Score this pawn // Score this pawn
if (isolated) if (isolated)
{ value -= IsolatedPawnPenalty[opposed][f];
value -= IsolatedPawnPenalty[f];
if (!opposed)
value -= IsolatedPawnPenalty[f] / 2;
}
if (doubled) if (doubled)
value -= DoubledPawnPenalty[f]; value -= DoubledPawnPenalty[opposed][f];
if (backward) if (backward)
{ value -= BackwardPawnPenalty[opposed][f];
value -= BackwardPawnPenalty[f];
if (!opposed)
value -= BackwardPawnPenalty[f] / 2;
}
if (chain) if (chain)
value += ChainBonus[f]; value += ChainBonus[f];
@ -246,4 +243,3 @@ Score PawnInfoTable::evaluate_pawns(const Position& pos, Bitboard ourPawns,
return value; return value;
} }