Tweak bonus for racing kings
authorianfab <ianfab@users.noreply.github.com>
Mon, 13 Aug 2018 19:28:44 +0000 (21:28 +0200)
committerianfab <ianfab@users.noreply.github.com>
Tue, 14 Aug 2018 18:35:50 +0000 (20:35 +0200)
racing kings STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 469 W: 262 L: 162 D: 45
http://35.161.250.236:6543/tests/view/5b71dcbb6e23db0fbab0dca0

src/evaluate.cpp

index 4333e24..b9ffc8d 100644 (file)
@@ -815,7 +815,7 @@ namespace {
             int dist =  distance(pos.square<KING>(Us), s)
                       + popcount(pos.attackers_to(s) & pos.pieces(Them))
                       + !!(pos.pieces(Us) & s);
-            score += make_score(3000, 3000) / (1 + dist * dist);
+            score += make_score(3000, 3000) / (1 + dist * (pos.checking_permitted() ? dist : 1));
         }
     }