Add PG option to show tablebase hits
authorH.G. Muller <h.g.muller@hccnet.nl>
Fri, 27 Dec 2013 19:49:25 +0000 (20:49 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Fri, 27 Dec 2013 19:49:25 +0000 (20:49 +0100)
The new option Polyglot ShowTbHits makes Polyglot prefix all PVs with
the number of EGT hits between braces.

option.c
uci.c
uci.h
xboard2uci.c

index 0feeea7..997a0d6 100644 (file)
--- 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 (file)
--- 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 (file)
--- 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;
index 893c99f..b8bcea1 100644 (file)
@@ -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 &&