From: H.G. Muller Date: Mon, 1 Nov 2010 12:42:30 +0000 (+0100) Subject: Switch to extinction-Chess win condition X-Git-Tag: 4.8P~8 X-Git-Url: http://winboard.nl/cgi-bin?p=fairymax.git;a=commitdiff_plain;h=288850bacd0c95c03b18c269e374adbb3cab1a60 Switch to extinction-Chess win condition Normal Chess is of course a form of extinction Chess where you have to exterminate the King piece type, since you only have a single one. Royalty is still indicated by negative piece value, bt a win now only occurs if you capture the last royal piece of its kind, rather than the first. The 'duple check' of Spartan Chess is treated as an exception, however: when there is choice between royal pieces to capture, this is sufficient for a win. --- diff --git a/data/fmax.ini b/data/fmax.ini index b4e9440..0384ecd 100644 --- a/data/fmax.ini +++ b/data/fmax.ini @@ -174,6 +174,13 @@ and the last one for black. If more than two have the same name, the others cannot be indicated at all, but they could still occur in the initial setup (where you specify them by number, not letter). +Pieces with negative values are considered royal. If one side has more than +one royal piece of the same type, he loses if the _last_ one is captured, +with the special rule that he is not allowed to leave more than one of +them under attack. This means the 'spare' royal pieces can be sacrificed, +and the exchange value assumed for them will be the absolute value of what +you define for them. + NOTE: piece value 181 for piece 7 is reserved for Makruk, and enables promotion on the 6th rank. Do not use it in other variants. diff --git a/fairymax.c b/fairymax.c index 2bf32d1..82f9c60 100644 --- a/fairymax.c +++ b/fairymax.c @@ -137,7 +137,7 @@ pboard() 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; + 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; struct _*a=A+(J+(k+S)*E&U-1); /* lookup pos. in hash table*/ *sp++=0; @@ -181,7 +181,7 @@ int k,q,l,e,E,z,n; /* (q,l)=window, e=current eval. score, E=e.p. sqr.*/ if(flag&1+!t) /* mode (capt/nonc) allowed?*/ {if(t&&(t&16)==k)break; /* capture own */ i=w[t&15]+((t&192)>>sh); /* value of capt. piece t */ - if(i<0)m=I,d=98; /* K capture */ + if(i<0&&(pl[t&31]<2||kk!=H&kk!=S||(kk=H,i=-i,0)))m=I,d=98;/* K capture, duple check */ if(m>=l&d>1)goto C; /* abort on fail high */ v=d-1?e:i-p; /*** MVV/LVA scoring if d=1**/ if(d-!t>1) /*** all captures if d=2 ***/ @@ -801,6 +801,8 @@ int main(int argc, char **argv) if(w[p]<0) { // Royal piece on original square: virgin if(color==BLACK && m<0x10 && p==oo[m+16] || color==WHITE && m>0x6F && p==oo[m-0x70]) b[m] -= 32; + Q-=w[p]; // assume value was flipped to indicate royalty + if(pl[p+color])R-=w[p]/FAC; // capturable King, add to material } else { Q+=w[p]; R+=w[p]/FAC; } if((m==0x00 || m==BW-1 ) && color==BLACK && p==oo[m+16] || (m==0x70 || m==0x6F+BW) && color==WHITE && p==oo[m-0x70])