X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=fairymax.c;h=f476379599ab2d70e07924d245ef7c39c84ca800;hb=e1316b1f8666776e17ab816faf28622306aa56e8;hp=3bd0c69fd8b1a4900641075a6d98d408737f0994;hpb=728c69e5f456df46ddb7391c7f02be3145ace80d;p=fairymax.git diff --git a/fairymax.c b/fairymax.c index 3bd0c69..f476379 100644 --- a/fairymax.c +++ b/fairymax.c @@ -18,7 +18,7 @@ /*****************************************************************/ #define MULTIPATH -#define VERSION "4.8S" +#define VERSION "4.8T" #include #include @@ -100,7 +100,7 @@ int Post; int Fifty; int GameNr; int Resign; -int Cambodian; +char Cambodian[80] = "makruk"; int Threshold = 800; int Score; int makruk; @@ -149,7 +149,7 @@ D(k,q,l,e,E,z,n) /* recursive minimax search, k=moving side, n=depth*/ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ { /* e=score, z=prev.dest; J,Z=hashkeys; return score*/ int j,r,m,v,d,h,i,F,G,P,V,f=J,g=Z,C,s,flag,FF,*ps=sp,kk=S; - signed char t,p,u,x,y,X,Y,H,B,gt,rg; + signed char t,p,u,x,y,X,Y,H,B,gt,rg,rk; struct _*a=A+(J+(k+S)*E&U); /* lookup pos. in hash table*/ *sp++=0; q-=q1) /*** all captures if d=2 ***/ {v=gt=0;G: /* retry move with gating */ v+=centr[p]?b[x+257]-b[y+257]:0; /* center positional pts. */ - if(!(G&S))b[FF]=b[G],v+=50; /* castling: put R & score */ + if(G-S)b[FF]=(rk=b[G])|32,v+=50; /* castling: put R & score */ b[G]=b[H]=0;b[x]=gt;b[y]=u|32; /* do move, set non-virgin */ pl[t&31]-=!!t; /* updat victim piece count */ v-=w[p]>0|R2&v>V&v12 || BH!=8) { printf("telluser unsupported board size %dx%d\n",BW,BH); exit(0); } + makruk = 0; if(fscanf(f, "=%d", &i)) makruk=64; // new method to indicate deviant zone depth (for now assumes 3) for(i=0; i15 || j>255) break; } - fclose(f); sh = w[7] < 250 ? 3 : 0; - makruk = w[7]==181 ? 64 : 0; // w[7] is used as kludge to enable makruk promotions - if(name == selectedFairy) { - printf(ptc == 1 ? "setup " : "setup (%s) ", pieceToChar); // setup board in GUI + if(ptc > 1) { // setup board in GUI, by sending it pieceToCharTable and FEN + if(ptc == 2) printf("setup (%s) ", pieceToChar); + else printf("setup (%s) %dx%d+0_%s ", pieceToChar, BW, BH, parent); for(i=0; iK = 0; if(sscanf(line+7, "MultiVariation Margin=%d", &margin) == 1) continue; if(sscanf(line+7, "Variant fairy selects=%s", selectedFairy+6) == 1) continue; - if(sscanf(line+7, "Cambodian Makruk rules=%d", &Cambodian) == 1) continue; + if(sscanf(line+7, "Makruk rules=%s", Cambodian) == 1) continue; continue; } if (!strcmp(command, "go")) { @@ -899,6 +908,8 @@ int main(int argc, char **argv) CopyBoard(HistPtr=HistPtr+1&1023); if(PrintResult(Side)) Computer = EMPTY; } + } } + return 0; }