Print promotion characterwith move
authorH.G. Muller <h.g.muller@hccnet.nl>
Mon, 1 Nov 2010 10:18:44 +0000 (11:18 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Mon, 1 Nov 2010 10:18:44 +0000 (11:18 +0100)
We cannot rely on the WinBoard default of Queen, as in some variants the
Queen might not participate.

fairymax.c

index b939cfc..6305a44 100644 (file)
@@ -93,6 +93,7 @@ int Resign;
 int Threshold = 800;\r
 int Score;\r
 int makruk;\r
+int prom;\r
 char piecename[32], piecetype[32], blacktype[32];\r
 char *inifile = INI_FILE;\r
 \r
@@ -214,8 +215,8 @@ int k,q,l,e,E,z,n;      /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/
         }\r
         if(z&S&&K-I)                           /* move pending: check legal*/\r
         {if(v+I&&x==K&y==L)                    /*   if move found          */\r
-         {Q=-e-i;O=F;LL=L;\r
-          if(b[y]-u&15)b[y]-=PromPiece,        /* under-promotion, correct */\r
+         {Q=-e-i;O=F;LL=L;prom=0;\r
+          if(b[y]-u&15)prom=b[y]-=PromPiece,   /* under-promotion, correct */\r
                        J+=PromPiece;           /*  piece & invalidate hash */\r
           a->D=99;a->V=0;                      /* lock game in hash as draw*/\r
           R-=i/FAC;                            /*** total captd material ***/\r
@@ -529,6 +530,7 @@ int main(int argc, char **argv)
                             printf("move ");\r
                             printf("%c%c%c%c",'a'+(K&15),'0'+BH-(K>>4),\r
                                           'a'+(L&15),'0'+BH-(L>>4));\r
+                           if(prom)printf("%c",piecename[prom&15]+'a'-1);\r
                             printf("\n");\r
                             m = GetTickCount() - Ticks;\r
 \r