Add 6th and 7th rank Pawn bonus when setting up position
authorH.G. Muller <h.g.muller@hccnet.nl>
Wed, 13 Feb 2013 19:02:13 +0000 (20:02 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Wed, 13 Feb 2013 22:10:18 +0000 (23:10 +0100)
Both the bonuses hidden in the board, as well as the total material
evaluation had to be added.

changelog
fairymax.c

index 33d71a1..6431c94 100644 (file)
--- a/changelog
+++ b/changelog
           * False mate claims in Spartan when promotion to K was possible
           * Fix bug in Berolina e.p. capture that is actually non-capture
           * Fix Clear Hash option, which did not work at all
+          * Fix addition of 6th & 7th-rank Pawn bonus when setting up position
           In addition it prints msec-accurate timing info.
 
index ffa6ca8..15a5ce5 100644 (file)
@@ -808,7 +808,7 @@ int main(int argc, char **argv)
                        continue;\r
                }\r
                 if (!strcmp(command, "edit")) {\r
-                        int color = WHITE, p;\r
+                        int color = WHITE, p, r;\r
 \r
                         while(fgets(line, 256, stdin)) {\r
                                 m = line[0];\r
@@ -835,16 +835,16 @@ int main(int argc, char **argv)
                                     } else\r
                                     if(line[1] >= 'a' && line[1] <= 'a'+BW-1\r
                                     && line[2] >= '1' && line[2] <= '0'+BH) {\r
-                                        m = line[1]-16*line[2]+799;\r
+                                        m = line[1]-16*line[2]+799; r = m & 0x70;\r
                                         switch(p)\r
                                         {\r
                                         case 1:\r
                                         case 2:\r
                                             if(color==WHITE)\r
-                                                 b[m]=(m&0x70)==0x60?1:33,\r
-                                                 Q+=w[1];\r
-                                            else b[m]=(m&0x70)==0x10?18:50,\r
-                                                 Q+=w[2];\r
+                                                 b[m]=r==0x10?161:r==0x20?97:r==0x60?1:33,\r
+                                                 Q+=w[1]+(r==0x10?S:r==0x20?64:0);\r
+                                            else b[m]=r==0x60?178:r==0x50?114:r==0x10?18:50,\r
+                                                 Q+=w[2]+(r==0x60?S:r==0x50?64:0);\r
                                             break;\r
                                         default:\r
                                             b[m]=p+color+32; // assume non-virgin\r