mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
Convert ThreatBonus to Score
No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
444c7c5183
commit
1ecd8e13ee
1 changed files with 12 additions and 21 deletions
|
@ -215,26 +215,17 @@ namespace {
|
||||||
|
|
||||||
// ThreatBonus[][] contains bonus according to which piece type
|
// ThreatBonus[][] contains bonus according to which piece type
|
||||||
// attacks which one.
|
// attacks which one.
|
||||||
const Value MidgameThreatBonus[8][8] = {
|
const Score ThreatBonus[8][8] = {
|
||||||
{ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
|
#define Z Score(0, 0)
|
||||||
{ V(0),V(18), V(0),V(37), V(55), V(55), V(0), V(0) }, // KNIGHT attacks
|
{ Z, Z, Z, Z, Z, Z, Z, Z }, // not used
|
||||||
{ V(0),V(18),V(37), V(0), V(55), V(55), V(0), V(0) }, // BISHOP attacks
|
{ Z, S(18,37), Z, S(37,47), S(55,97), S(55,97), Z, Z }, // KNIGHT attacks
|
||||||
{ V(0), V(9),V(27),V(27), V(0), V(37), V(0), V(0) }, // ROOK attacks
|
{ Z, S(18,37), S(37,47), Z, S(55,97), S(55,97), Z, Z }, // BISHOP attacks
|
||||||
{ V(0),V(27),V(27),V(27), V(27), V(0), V(0), V(0) }, // QUEEN attacks
|
{ Z, S( 9,27), S(27,47), S(27,47), Z, S(37,47), Z, Z }, // ROOK attacks
|
||||||
{ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
|
{ Z, S(27,37), S(27,37), S(27,37), S(27,37), Z, Z, Z }, // QUEEN attacks
|
||||||
{ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
|
{ Z, Z, Z, Z, Z, Z, Z, Z }, // not used
|
||||||
{ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) } // not used
|
{ Z, Z, Z, Z, Z, Z, Z, Z }, // not used
|
||||||
};
|
{ Z, Z, Z, Z, Z, Z, Z, Z } // not used
|
||||||
|
#undef Z
|
||||||
const Value EndgameThreatBonus[8][8] = {
|
|
||||||
{ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
|
|
||||||
{ V(0),V(37), V(0),V(47), V(97), V(97), V(0), V(0) }, // KNIGHT attacks
|
|
||||||
{ V(0),V(37),V(47), V(0), V(97), V(97), V(0), V(0) }, // BISHOP attacks
|
|
||||||
{ V(0),V(27),V(47),V(47), V(0), V(47), V(0), V(0) }, // ROOK attacks
|
|
||||||
{ V(0),V(37),V(37),V(37), V(37), V(0), V(0), V(0) }, // QUEEN attacks
|
|
||||||
{ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
|
|
||||||
{ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) }, // not used
|
|
||||||
{ V(0), V(0), V(0), V(0), V(0), V(0), V(0), V(0) } // not used
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// ThreatedByPawnPenalty[] contains a penalty according to which piece
|
// ThreatedByPawnPenalty[] contains a penalty according to which piece
|
||||||
|
@ -717,7 +708,7 @@ namespace {
|
||||||
if (b)
|
if (b)
|
||||||
for (PieceType pt2 = PAWN; pt2 < KING; pt2++)
|
for (PieceType pt2 = PAWN; pt2 < KING; pt2++)
|
||||||
if (b & pos.pieces(pt2))
|
if (b & pos.pieces(pt2))
|
||||||
bonus += Score(MidgameThreatBonus[pt1][pt2], EndgameThreatBonus[pt1][pt2]);
|
bonus += ThreatBonus[pt1][pt2];
|
||||||
}
|
}
|
||||||
ei.value += Sign[Us] * bonus;
|
ei.value += Sign[Us] * bonus;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue