From 860a51b1cad9c3d4ba9823e412220de93ceea4dc Mon Sep 17 00:00:00 2001 From: ianfab Date: Sat, 28 Jul 2018 13:24:02 +0200 Subject: [PATCH] Fix king piece-square table chess STC LLR: 2.97 (-2.94,2.94) [0.00,10.00] Total: 984 W: 284 L: 205 D: 495 bench: 4515065 --- src/psqt.cpp | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/psqt.cpp b/src/psqt.cpp index 04c6919..7521faf 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -93,8 +93,10 @@ constexpr Score Bonus[PIECE_TYPE_NB][RANK_NB][int(FILE_NB) / 2] = { { S(-2,-40), S( 6,-16), S( 8,-10), S(10, 3) }, { S(-2,-55), S( 7,-30), S( 7,-21), S( 6, -6) }, { S(-1,-74), S(-4,-55), S(-1,-43), S( 0,-30) } - }, - { // King + } +}; + +constexpr Score KingBonus[RANK_NB][int(FILE_NB) / 2] = { { S(267, 0), S(320, 48), S(270, 75), S(195, 84) }, { S(264, 43), S(304, 92), S(238,143), S(180,132) }, { S(200, 83), S(245,138), S(176,167), S(110,165) }, @@ -103,7 +105,6 @@ constexpr Score Bonus[PIECE_TYPE_NB][RANK_NB][int(FILE_NB) / 2] = { { S(118, 95), S(159,155), S( 84,176), S( 41,174) }, { S( 87, 50), S(128, 99), S( 63,122), S( 20,139) }, { S( 63, 9), S( 88, 55), S( 47, 80), S( 0, 90) } - } }; #undef S @@ -127,7 +128,7 @@ void init() { for (Square s = SQ_A1; s <= SQ_H8; ++s) { File f = std::min(file_of(s), ~file_of(s)); - psq[ pc][ s] = score + Bonus[pc][rank_of(s)][f]; + psq[ pc][ s] = score + (pt == KING ? KingBonus[rank_of(s)][f] : Bonus[pc][rank_of(s)][f]); psq[~pc][~s] = -psq[pc][s]; } // pieces in pocket -- 1.7.0.4