Print static eval with thinking output
[hachu.git] / hachu.c
diff --git a/hachu.c b/hachu.c
index 87b227f..6de0d39 100644 (file)
--- a/hachu.c
+++ b/hachu.c
@@ -799,6 +799,20 @@ Init (int var)
   p[EDGE].qval = 5; // tenjiku jump-capturer sentinel\r
 }\r
 \r
+int\r
+PSTest ()\r
+{\r
+  int r, f, score, tot=0;\r
+  for(r=0; r<BH; r++) for(f=0; f<BH; f++) {\r
+    int s = BW*r+f;\r
+    int piece = board[s];\r
+    if(!piece) continue;\r
+    score = p[piece].value + PST[p[piece].pst + s];\r
+    if(piece & 1) tot += score; else tot -= score;\r
+  }\r
+  return tot;\r
+}\r
+\r
 int flag;\r
 \r
 inline int\r
@@ -1704,7 +1718,9 @@ if(PATH) printf("%d:%2d:%d %3d %6x %-10s %6d %6d\n", level, depth, iterDep, curM
         int i;   // WB thinking output\r
        printf("%d %d %d %d", iterDep, bestScore, (GetTickCount() - startTime)/10, nodes);\r
        for(i=0; pv[i]; i++) printf(" %s", MoveToText(pv[i], 0));\r
-       printf("\n"); fflush(stdout);\r
+        if(iterDep == 1) printf(" { root eval = %4.2f dif = %4.2f; abs = %4.2f}", curEval/100., difEval/100., PSTest()/100.);\r
+       printf("\n");\r
+        fflush(stdout);\r
       }\r
       if(GetTickCount() - startTime > tlim1) break; // do not start iteration we can (most likely) not finish\r
     }\r