Fix King location in Eval
authorH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 6 Feb 2017 17:07:43 +0000 (18:07 +0100)
committerH.G.Muller <hgm@hgm-xboard.(none)>
Mon, 6 Feb 2017 17:07:43 +0000 (18:07 +0100)
The evaluation routine still assumed location[] was an array of 64,
rather than 96, so it expected the King location in the wrong place.

dropper.c

index 2ea7144..6fd442d 100644 (file)
--- a/dropper.c
+++ b/dropper.c
@@ -713,12 +713,12 @@ int
 Evaluate (int stm, int rights)
 {
     int k, score = 0;
-    k = location[31];
+    k = location[WHITE+31];
     score += ((board[k+22] == WHITE) + (board[k+22+1] == WHITE) + (board[k+22-1] == WHITE))*2;
     score -= !board[k+22] + !board[k+22+1] + !board[k+22-1];
     score -= ((board[k+44] == BLACK) + (board[k+44+1] == BLACK) + (board[k+44-1] == BLACK))*5;
     if(k >= killZone) score -= 100;
-    k = location[WHITE+31];
+    k = location[BLACK+31];
     score -= ((board[k-22] == BLACK) + (board[k-22+1] == BLACK) + (board[k-22-1] == BLACK))*2;
     score += !board[k-22] + !board[k-22+1] + !board[k-22-1];
     score += ((board[k-44] == WHITE) + (board[k-44+1] == WHITE) + (board[k-44-1] == WHITE))*5;