From 804ec8ebc971e4e92c96e7209df3f0743a36a70b Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Wed, 13 Feb 2013 20:02:13 +0100 Subject: [PATCH] Add 6th and 7th rank Pawn bonus when setting up position Both the bonuses hidden in the board, as well as the total material evaluation had to be added. --- changelog | 1 + fairymax.c | 12 ++++++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/changelog b/changelog index 33d71a1..6431c94 100644 --- a/changelog +++ b/changelog @@ -111,5 +111,6 @@ * 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. diff --git a/fairymax.c b/fairymax.c index ffa6ca8..15a5ce5 100644 --- a/fairymax.c +++ b/fairymax.c @@ -808,7 +808,7 @@ int main(int argc, char **argv) continue; } if (!strcmp(command, "edit")) { - int color = WHITE, p; + int color = WHITE, p, r; while(fgets(line, 256, stdin)) { m = line[0]; @@ -835,16 +835,16 @@ int main(int argc, char **argv) } else if(line[1] >= 'a' && line[1] <= 'a'+BW-1 && line[2] >= '1' && line[2] <= '0'+BH) { - m = line[1]-16*line[2]+799; + m = line[1]-16*line[2]+799; r = m & 0x70; switch(p) { case 1: case 2: if(color==WHITE) - b[m]=(m&0x70)==0x60?1:33, - Q+=w[1]; - else b[m]=(m&0x70)==0x10?18:50, - Q+=w[2]; + b[m]=r==0x10?161:r==0x20?97:r==0x60?1:33, + Q+=w[1]+(r==0x10?S:r==0x20?64:0); + else b[m]=r==0x60?178:r==0x50?114:r==0x10?18:50, + Q+=w[2]+(r==0x60?S:r==0x50?64:0); break; default: b[m]=p+color+32; // assume non-virgin -- 1.7.0.4