X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=6305a449b2c23b7dd3cc81578dbe5c87f6ea632e;hb=18e3a22339d477d3d27550a9fe49aaaed0c14fff;hp=e615fd4064863efa5d03562f8323da3c92e933a8;hpb=72b198f0b7575ff63748b7c02b1572ed162aef04;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index e615fd4..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 ***/ @@ -331,13 +332,6 @@ int PrintResult(int s) printf("1-0 {Bare King}\n"); return 5; } - if(cnt>-I+1 && K==0 && L==0) { - if (s == WHITE) - printf("0-1 {Stalemate}\n"); - else - printf("1-0 {Stalemate}\n"); - return 2; - } #else if(cnt>-I+1 && K==0 && L==0) { printf("1/2-1/2 {Stalemate}\n"); @@ -536,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;