From 18e3a22339d477d3d27550a9fe49aaaed0c14fff Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Mon, 1 Nov 2010 11:18:44 +0100 Subject: [PATCH] Print promotion characterwith move We cannot rely on the WinBoard default of Queen, as in some variants the Queen might not participate. --- fairymax.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fairymax.c b/fairymax.c index b939cfc..6305a44 100644 --- a/fairymax.c +++ b/fairymax.c @@ -93,6 +93,7 @@ int Resign; int Threshold = 800; int Score; int makruk; +int prom; char piecename[32], piecetype[32], blacktype[32]; char *inifile = INI_FILE; @@ -214,8 +215,8 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ } if(z&S&&K-I) /* move pending: check legal*/ {if(v+I&&x==K&y==L) /* if move found */ - {Q=-e-i;O=F;LL=L; - if(b[y]-u&15)b[y]-=PromPiece, /* under-promotion, correct */ + {Q=-e-i;O=F;LL=L;prom=0; + if(b[y]-u&15)prom=b[y]-=PromPiece, /* under-promotion, correct */ J+=PromPiece; /* piece & invalidate hash */ a->D=99;a->V=0; /* lock game in hash as draw*/ R-=i/FAC; /*** total captd material ***/ @@ -529,6 +530,7 @@ int main(int argc, char **argv) printf("move "); printf("%c%c%c%c",'a'+(K&15),'0'+BH-(K>>4), 'a'+(L&15),'0'+BH-(L>>4)); + if(prom)printf("%c",piecename[prom&15]+'a'-1); printf("\n"); m = GetTickCount() - Ticks; -- 1.7.0.4