X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Fpawns.cpp;h=c8c2e6d8c243db77d67b30afd109dfd2ea1fff4f;hb=3cc47edf622b1d12a37b3637cae503d6862437c4;hp=1934628e010eb06b11f2c75d5a4ce1ebab946f52;hpb=25cb851f8aa914634666789473a7809695dec6d1;p=stockfish diff --git a/src/pawns.cpp b/src/pawns.cpp index 1934628e..c8c2e6d8 100644 --- a/src/pawns.cpp +++ b/src/pawns.cpp @@ -52,10 +52,15 @@ namespace { S(33, 31), S(33, 31), S(29, 31), S(20, 28) }}; // Pawn chain membership bonus by file - const Score ChainMember[FILE_NB] = { - S(11,-1), S(13,-1), S(13,-1), S(14,-1), - S(14,-1), S(13,-1), S(13,-1), S(11,-1) - }; + const Score ChainMember[FILE_NB][RANK_NB] = { + { S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(28, 28), S(52, 104), S(118, 236) }, + { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) }, + { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) }, + { S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(33, 33), S(59, 118), S(127, 254) }, + { S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(33, 33), S(59, 118), S(127, 254) }, + { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) }, + { S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(30, 30), S(54, 108), S(120, 240) }, + { S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(28, 28), S(52, 104), S(118, 236) }}; // Candidate passed pawn bonus by rank const Score CandidatePassed[RANK_NB] = { @@ -176,7 +181,7 @@ namespace { value -= Backward[opposed][f]; if (chain) - value += ChainMember[f] + CandidatePassed[relative_rank(Us, s)] / 2; + value += ChainMember[f][relative_rank(Us, s)]; if (candidate) { @@ -227,13 +232,13 @@ Value Entry::shelter_storm(const Position& pos, Square ksq) { Rank rkUs, rkThem; File kf = std::max(FILE_B, std::min(FILE_G, file_of(ksq))); - for (int f = kf - 1; f <= kf + 1; ++f) + for (File f = kf - File(1); f <= kf + File(1); ++f) { - b = ourPawns & FileBB[f]; + b = ourPawns & file_bb(f); rkUs = b ? relative_rank(Us, backmost_sq(Us, b)) : RANK_1; safety -= ShelterWeakness[rkUs]; - b = theirPawns & FileBB[f]; + b = theirPawns & file_bb(f); rkThem = b ? relative_rank(Us, frontmost_sq(Them, b)) : RANK_1; safety -= StormDanger[rkUs == RANK_1 ? 0 : rkThem == rkUs + 1 ? 2 : 1][rkThem]; }