Smoothen PSQTs for large boards
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 18 Oct 2018 21:49:33 +0000 (23:49 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 18 Oct 2018 21:49:33 +0000 (23:49 +0200)
shogi
ELO: 36.62 +-47.5 (95%) LOS: 93.7%
Total: 200 W: 106 L: 85 D: 9

No functional change for board sizes <= 8x8.

src/psqt.cpp

index c646508..82544cb 100644 (file)
@@ -128,7 +128,7 @@ void init() {
       for (Square s = SQ_A1; s <= SQ_MAX; ++s)
       {
           File f = std::min(file_of(s), ~file_of(s));
-          psq[ pc][ s] = score + (pt == KING ? KingBonus[rank_of(s)][f] : Bonus[pc][rank_of(s)][f]);
+          psq[ pc][ s] = score + (pt == KING ? KingBonus[std::min(rank_of(s), RANK_8)][std::min(f, FILE_D)] : Bonus[pc][std::min(rank_of(s), RANK_8)][std::min(f, FILE_D)]);
           psq[~pc][~s] = -psq[pc][s];
       }
       // pieces in pocket