XBoard: use xboard v2-compatible move output ("move" command, no milliseconds)
authorH.G. Muller <h.g.muller@hccnet.nl>
Tue, 21 Jan 2014 19:56:29 +0000 (20:56 +0100)
committerYann Dirson <ydirson@free.fr>
Mon, 17 Feb 2014 22:05:19 +0000 (23:05 +0100)
YD: split original patch into a series
YD: simplified slightly

gnushogi/rawdsp.c

index 5f04dca..a856806 100644 (file)
@@ -521,12 +521,15 @@ Raw_OutputMove(void)
     if (mvstr[0][0] == '\0')
         goto nomove;
 
-    if (XSHOGI)
+    mycnt1++;
+    if (XSHOGI && xboard) /* xboard: print move in XBoard format, with 'move' prefix */
+        printf("move %s\n", mvstr[0]);
+    else if (XSHOGI)
         /* add remaining time in milliseconds to xshogi */
-        printf("%d. ... %s %ld\n", ++mycnt1, mvstr[0],
+        printf("%d. ... %s %ld\n", mycnt1, mvstr[0],
                (TimeControl.clock[player] - et) * 10);
     else
-        printf("%d. ... %s\n", ++mycnt1, mvstr[0]);
+        printf("%d. ... %s\n", mycnt1, mvstr[0]);
 
  nomove:
     if ((root->flags & draw) || (root->score == -(SCORE_LIMIT + 999))