int castlings; // end of list of board moves without castlings
int epSqr;
int checker;
- int safety, hole, escape;
+ int safety, cBonus, hole, escape;
} MoveStack;
HashEntry *hashTable;
Key hashKey, pawnKey;
int hashMask;
+static int rightsScore[] = { 0, -10, 10, 0, -10, -30, 0, -20, 10, 0, 30, 20, 0, -20, 20, 0 };
+
int
-Evaluate (int stm)
+Evaluate (int stm, int rights)
{
int k, score = 0;
k = location[31];
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;
score *= 20;
+ score += rightsScore[rights];
return stm == WHITE ? score : -score;
}
f++;
if(board[r-1] == 0 && board[r-2] == 0 && board[r-3] == 0) f += 2, moveStack[moveSP++] = r << 8 | 8*22+21 + 22*(stm == BLACK);
}
+ m->cBonus = f;
r = location[stm+31^COLOR]; // enemy King
# define HOLE(X) (attacks[X] == c)*!board[X]
}
if((++nodeCount & 0xFFF) == 0) abortFlag |= TimeIsUp(3); // check time limit every 4K nodes
- curEval = f.pstEval + Evaluate(stm);
+ curEval = f.pstEval + Evaluate(stm, f.rights);
alpha -= (alpha < curEval); //pre-compensate delayed-loss bonus
beta -= (beta <= curEval);
killers[ply+1][0] = killers[ply+1][1] = 0;