From: Stéphane Nicolet Date: Sat, 21 May 2016 08:05:19 +0000 (+0200) Subject: Pins or discovered attacks on the opponent's queen X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=07b247f9434f3633570aa124539ed5d2fc4f904f;ds=sidebyside Pins or discovered attacks on the opponent's queen Bonus for pins or discovered attacks on the opponent's queen STC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 32020 W: 5914 L: 5652 D: 20454 LTC: LLR: 2.97 (-2.94,2.94) [0.00,5.00] Total: 10946 W: 1530 L: 1375 D: 8041 Bench: 7031649 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 4a52e626..58058b1b 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -187,6 +187,7 @@ namespace { const Score OtherCheck = S(10, 10); const Score ThreatByHangingPawn = S(71, 61); const Score LooseEnemies = S( 0, 25); + const Score WeakQueen = S(35, 0); const Score Hanging = S(48, 27); const Score ThreatByPawnPush = S(38, 22); const Score Unstoppable = S( 0, 20); @@ -488,6 +489,13 @@ namespace { & ~(ei.attackedBy[Us][ALL_PIECES] | ei.attackedBy[Them][ALL_PIECES])) score += LooseEnemies; + // Bonus for pin or discovered attack on the opponent queen + if ( pos.count(Them) == 1 + && pos.slider_blockers(pos.pieces(), + pos.pieces(Us, ROOK, BISHOP), + pos.square(Them))) + score += WeakQueen; + // Non-pawn enemies attacked by a pawn weak = (pos.pieces(Them) ^ pos.pieces(Them, PAWN)) & ei.attackedBy[Us][PAWN];