From: Ada Joule Date: Sat, 28 Mar 2020 13:34:15 +0000 (+0700) Subject: Increase leapers' value in makpong X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=ced296369084a7196fc2f398bb3267bf47664fee;p=fairystockfish.git Increase leapers' value in makpong 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 --- diff --git a/src/psqt.cpp b/src/psqt.cpp index 0b2d37c..a483ea4 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -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)), diff --git a/src/types.h b/src/types.h index 3cc8105..d3b7662 100644 --- a/src/types.h +++ b/src/types.h @@ -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