From: Fabian Fichter Date: Wed, 12 Feb 2020 17:46:06 +0000 (+0100) Subject: Disable makruk counting for positions with pawns X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=572117582c9027347dec3e8b13b28e343ec5bf95;p=fairystockfish.git Disable makruk counting for positions with pawns makruk STC LLR: 2.96 (-2.94,2.94) [-10.00,5.00] Total: 2064 W: 169 L: 136 D: 1759 http://www.variantfishtest.org:6543/tests/view/5e4308466e23db46beba4e06 makruk LTC LLR: 3.01 (-2.94,2.94) [-10.00,5.00] Total: 2530 W: 163 L: 130 D: 2237 http://www.variantfishtest.org:6543/tests/view/5e430b2d6e23db46beba4e09 Closes #75. --- diff --git a/src/position.cpp b/src/position.cpp index 8581782..ef0ed6a 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1355,11 +1355,11 @@ void Position::do_move(Move m, StateInfo& newSt, bool givesCheck) { sideToMove = ~sideToMove; if ( counting_rule() - && ( ((!st->countingLimit || captured) && count(sideToMove) == 1) - || (!st->countingLimit && !count()))) + && (!st->countingLimit || (captured && count(sideToMove) == 1)) + && counting_limit()) { st->countingLimit = 2 * counting_limit(); - st->countingPly = st->countingLimit && count(sideToMove) == 1 ? 2 * count() : 0; + st->countingPly = count(sideToMove) == 1 ? 2 * count() : 0; } // Update king attacks used for fast check detection @@ -1762,7 +1762,7 @@ bool Position::is_optional_game_end(Value& result, int ply) const { // counting rules if ( counting_rule() && st->countingLimit - && st->countingPly >= st->countingLimit + && st->countingPly > st->countingLimit && (!checkers() || MoveList(*this).size())) { result = VALUE_DRAW; @@ -1945,17 +1945,15 @@ int Position::counting_limit() const { assert(counting_rule()); - // No counting yet - if (count() && count(sideToMove) > 1) - return 0; - switch (counting_rule()) { case MAKRUK_COUNTING: + // No counting for side to move + if (count() || count(~sideToMove) == 1) + return 0; // Board's honor rule if (count(sideToMove) > 1) return 64; - // Pieces' honor rule if (count(~sideToMove) > 1) return 8;