From: H.G.Muller Date: Tue, 20 Oct 2015 15:09:22 +0000 (+0200) Subject: Make new XBoard mate-score convention default X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=commitdiff_plain;h=d86ce4e08b86a96a5cdfc4fb52e4601b0665911b Make new XBoard mate-score convention default XBoard now uses 100000+DTM as matescore; this encoding will be used when the Polyglot MateSCore option is set to 0, which is the new default value. --- diff --git a/option.c b/option.c index 5784e1d..9e83126 100644 --- a/option.c +++ b/option.c @@ -51,7 +51,7 @@ option_t DefaultOptions[] = { { "HandleDraws", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD|XBSEL}, { "ContemptScore", "spin","0","10000", "30" , NULL,0,NNB, PG|XBOARD|XBSEL}, - { "MateScore", "spin","0","100000", "10000" , NULL,0,NNB, PG|XBOARD}, + { "MateScore", "spin","0","100000", "0" , NULL,0,NNB, PG|XBOARD}, { "Book", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD|XBSEL|UCI}, { "BookFile", "file","0","0", "book.bin" , NULL,0,NNB, PG|XBOARD|XBSEL|UCI}, diff --git a/polyglot.pod b/polyglot.pod index faffa1a..7b82121 100644 --- a/polyglot.pod +++ b/polyglot.pod @@ -486,9 +486,11 @@ many seconds before doing the next kibitz. If true PolyGlot will not understand xboard commands. -=item B (default: 10000) +=item B (default: 0) Mate score reported to GUI when in xboard mode. +When set to 0 it uses the new CECP convention of reporting 100000 + N +for mate in N moves, and -(100000 + N) for mated in N. =item B (default: false) diff --git a/uci.c b/uci.c index 0675320..2cd57e5 100644 --- a/uci.c +++ b/uci.c @@ -953,13 +953,17 @@ static void parse_score(uci_t * uci, const char string[]) { static int mate_score(int dist) { + int ms = option_get_int(Option,"MateScore"); + ASSERT(dist!=0); if (FALSE) { + } else if (ms == 0) { + return (dist > 0 ? 100000 + dist : -100000 + dist); } else if (dist > 0) { - return +option_get_int(Option,"MateScore") - (+dist) * 2 + 1; + return +ms - (+dist) * 2 + 1; } else if (dist < 0) { - return -option_get_int(Option,"MateScore") + (-dist) * 2; + return -ms + (-dist) * 2; } return 0;