Increase leapers' value in makpong
authorAda Joule <ada.fulmina@gmail.com>
Sat, 28 Mar 2020 13:34:15 +0000 (20:34 +0700)
committerFabian Fichter <ianfab@users.noreply.github.com>
Mon, 30 Mar 2020 08:03:19 +0000 (10:03 +0200)
makpong STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 932 W: 357 L: 268 D: 307
http://www.variantfishtest.org:6543/tests/view/5e7f52fa6e23db4f73614acf

makpong LTC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 1838 W: 654 L: 554 D: 630
http://www.variantfishtest.org:6543/tests/view/5e8038f96e23db4f73614add

src/psqt.cpp
src/types.h

index 0b2d37c..a483ea4 100644 (file)
@@ -153,6 +153,15 @@ void init(const Variant* v) {
                              eg_value(score) * (lc * leaper + r1 * slider) / (lc * leaper + r0 * slider));
       }
 
+      // Increase leapers' value in makpong
+      if (v->makpongRule)
+      {
+          if (std::any_of(pi->stepsCapture.begin(), pi->stepsCapture.end(), [](Direction d) { return dist(d) > 1; })
+                  && !pi->lameLeaper)
+              score = make_score(mg_value(score) * 4200 / (3500 + mg_value(score)),
+                                 eg_value(score) * 4700 / (3500 + mg_value(score)));
+      }
+
       // For drop variants, halve the piece values
       if (v->capturesToHand)
           score = make_score(mg_value(score) * 3500 / (7000 + mg_value(score)),
index 3cc8105..d3b7662 100644 (file)
@@ -729,4 +729,9 @@ inline bool is_ok(Move m) {
   return from_sq(m) != to_sq(m) || type_of(m) == PROMOTION; // Catch MOVE_NULL and MOVE_NONE
 }
 
+inline int dist(Direction d) {
+  return std::abs(d % NORTH) < NORTH / 2 ? std::max(std::abs(d / NORTH), std::abs(d % NORTH))
+      : std::max(std::abs(d / NORTH) + 1, NORTH - std::abs(d % NORTH));
+}
+
 #endif // #ifndef TYPES_H_INCLUDED