From: H.G. Muller Date: Wed, 15 Jan 2014 21:35:23 +0000 (+0100) Subject: Implement new mate-score standard X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=682bb14684d3d8be078029778e08ec2b48bae65e Implement new mate-score standard Matescores are now indicated in the protocol as +/- 100000+DTM, and in the Engine Output window as #DTM or #-DTM. --- diff --git a/engine-intf.html b/engine-intf.html index 969495b..3b7cb6c 100644 --- a/engine-intf.html +++ b/engine-intf.html @@ -1830,6 +1830,11 @@ the reported score is from a fail low, and thus represents an upper bound only. Similarly, an exclamation point should be used to indicate a fail high / lower bound.

+

+Mate scores should be indicated as 100000 + N for "mate in N moves", +and -100000 - N for "mated in N moves". +

+

Example:

diff --git a/engineoutput.c b/engineoutput.c index 75e1f8d..1ca977b 100644 --- a/engineoutput.c +++ b/engineoutput.c @@ -434,6 +434,7 @@ InsertionPoint (int len, EngineOutputData *ed) return offs + strlen(header[ed->which]); } +#define MATE_SCORE 100000 static char spaces[] = " "; // [HGM] align: spaces for padding static void @@ -590,6 +591,8 @@ UpdateControls (EngineOutputData *ed) if( h == 0 ) { snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), " 0.00%c\t", fail ); } else + if( h >= MATE_SCORE) snprintf(s_score, 16, " %s#%d%c\t", ( h > MATE_SCORE+9 ? "" : " "), h - MATE_SCORE, fail ); else + if(-h >= MATE_SCORE) snprintf(s_score, 16, " %s#-%d%c\t", (-h > MATE_SCORE+9 ? "" : " "), -h - MATE_SCORE, fail ); else if( h > 0 ) { snprintf( s_score, sizeof(s_score)/sizeof(s_score[0]), "+%.2f%c\t", h / 100.0, fail ); }