From: H.G. Muller Date: Fri, 27 Dec 2013 19:49:25 +0000 (+0100) Subject: Add PG option to show tablebase hits X-Git-Url: http://winboard.nl/cgi-bin?p=polyglot.git;a=commitdiff_plain;h=50a1a4edffe8b24fa1b0e05ab46c004d757f2a74 Add PG option to show tablebase hits The new option Polyglot ShowTbHits makes Polyglot prefix all PVs with the number of EGT hits between braces. --- diff --git a/option.c b/option.c index 0feeea7..997a0d6 100644 --- a/option.c +++ b/option.c @@ -60,6 +60,7 @@ option_t DefaultOptions[] = { { "BookDepth", "spin","0","256", "256" , NULL,0,NNB, PG|XBOARD|XBSEL|UCI}, { "BookTreshold", "spin","0","1000", "5" , NULL,0,NNB, PG|XBOARD|UCI}, { "BookLearn", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, + { "ShowTbHits", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD|XBSEL}, { "KibitzMove", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, { "KibitzPV", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, diff --git a/uci.c b/uci.c index 42b5971..eafefe4 100644 --- a/uci.c +++ b/uci.c @@ -715,6 +715,8 @@ static int parse_info(uci_t * uci, const char string[]) { ln = my_atoll(argument); ASSERT(ln>=0); + if (ln >= 0) uci->tbhit_nb = ln; + } else if (my_string_equal(option,"time")) { ASSERT(!my_string_empty(argument)); diff --git a/uci.h b/uci.h index cac77df..b163616 100644 --- a/uci.h +++ b/uci.h @@ -54,6 +54,7 @@ typedef struct { char bestmove[UciStringSize]; sint64 node_nb; + sint64 tbhit_nb; double time; double speed; double cpu; diff --git a/xboard2uci.c b/xboard2uci.c index 893c99f..b8bcea1 100644 --- a/xboard2uci.c +++ b/xboard2uci.c @@ -1718,7 +1718,9 @@ static void send_pv() { if(Uci->depth==-1) //hack to clear the engine output window gui_send(GUI,"%d %+d %.0f "S64_FORMAT" ",0,report_best_score(),Uci->time*100.0,Uci->node_nb); - + if(option_get_bool(Option,"ShowTbHits")) + gui_send(GUI,"%d %+d %.0f "S64_FORMAT" {"S64_FORMAT"} %s",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,Uci->tbhit_nb,pv_string); + else gui_send(GUI,"%d %+d %.0f "S64_FORMAT" %s",Uci->best_depth,report_best_score(),Uci->time*100.0,Uci->node_nb,pv_string); } else if (State->state == PONDER &&