From 1e80e397628885e927d507ef6ff2fe1545f48b39 Mon Sep 17 00:00:00 2001 From: Arseniy <93079612+codedeliveryservice@users.noreply.github.com> Date: Sun, 1 Oct 2023 01:45:30 +0300 Subject: [PATCH] Penalize doubled pawns (+23 tokens) Score of Dev vs Main: 357 - 281 - 441 [0.535] 1079 ... Dev playing White: 178 - 141 - 220 [0.534] 539 ... Dev playing Black: 179 - 140 - 221 [0.536] 540 ... White vs Black: 318 - 320 - 441 [0.499] 1079 Elo difference: 24.5 +/- 15.9, LOS: 99.9 %, DrawRatio: 40.9 % SPRT: llr 2.96 (100.4%), lbound -2.94, ubound 2.94 - H1 was accepted --- Chess-Challenge/src/My Bot/MyBot.cs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Chess-Challenge/src/My Bot/MyBot.cs b/Chess-Challenge/src/My Bot/MyBot.cs index a5a6137..28cd637 100644 --- a/Chess-Challenge/src/My Bot/MyBot.cs +++ b/Chess-Challenge/src/My Bot/MyBot.cs @@ -151,9 +151,11 @@ int AlphaBeta(int depth, int alpha, int beta, bool nullMoveAllowed = true, bool ulong bitboard = board.GetPieceBitboard((PieceType)piece + 1, xor is 56); while (bitboard != 0) { - int index = piece + // piece index - 16 * (BitboardHelper.ClearAndGetIndexOfLSB(ref bitboard) // row of square - ^ xor); // flip board for white pieces + int square = BitboardHelper.ClearAndGetIndexOfLSB(ref bitboard) ^ xor; + int index = piece + 16 * square; + + if (piece == 0 && (0x101010101010101UL << (square & 7) & bitboard) > 0) + egScore -= 9; mgScore += pieceSquareTables[index]; egScore += pieceSquareTables[index + 6];