Update docs and version number (4.8P)
[fairymax.git] / fairymax.c
index 5b2e98a..36bda21 100644 (file)
@@ -18,7 +18,7 @@
      /*****************************************************************/\r
 \r
 #define MULTIPATH\r
-#define VERSION "4.8O"\r
+#define VERSION "4.8P"\r
 \r
 #include <stdio.h>\r
 #include <stdlib.h>\r
@@ -181,7 +181,8 @@ 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?*/\r
       {if(t&&(t&16)==k)break;                  /* capture own              */\r
        i=w[t&15]+((t&192)>>sh);                /* value of capt. piece t   */\r
-       if(i<0&&(pl[t&31]<2||kk!=H&kk!=S||(kk=H,i=-i,0)))m=I,d=98;/* K capture, duple check */\r
+       if(i<0&&(pl[t&31]<2||                   /* K capture, (of last K),  */\r
+        t>>3&kk!=H&kk!=S||(kk=H,i=-i,0)))m=I,d=98;/* or duple check: cutoff*/\r
        if(m>=l&d>1)goto C;                     /* abort on fail high       */\r
        v=d-1?e:i-p;                            /*** MVV/LVA scoring if d=1**/\r
        if(d-!t>1)                              /*** all captures if d=2  ***/\r
@@ -372,6 +373,8 @@ InitGame()
  K=BW;W(K--)\r
  {b[K]=oo[K+16]+16;b[K+112]=oo[K];b[K+16]=18;b[K+96]=1; /* initial board setup*/\r
   pl[oo[K+16]+16]++;pl[oo[K]]++;pl[18]++;pl[1]++;\r
+  if(w[oo[K+16]+16] == -1)pl[oo[K+16]+16]=1;\r
+  if(w[oo[K]] == -1)pl[oo[K]]=1;\r
   L=8;W(L--)b[16*L+K+257]=(K-BW/2)*(K-BW/2)+(L-3.5)*(L-3.5); /* center-pts table   */\r
  }                                                   /*(in unused half b[])*/\r
  Side = WHITE; Q=0; O=S;\r
@@ -812,6 +815,7 @@ int main(int argc, char **argv)
                                             break;\r
                                         }\r
                                         pl[BLACK+WHITE-color]++;pl[p+color]++;\r
+                                        if(w[p+color] == -1)pl[p+color]=1; // fake we have one if value = -1, to thwart extinction condition\r
                                         continue;\r
                                 }\r
                         }\r