I am having a little difficulty understanding how to incorporate promotion captures into the SEE. Do I just ignore them (seems like a bad idea), or do I do something else?
I think I understand en passant captures in the recursive implementation (I don't have to generate them, because en passant recaptures are impossible)
Any help would be appreciated
P.S: here is my code for the recursive implementation, if you need it
Code: Select all
// evaluate the static exchange value of the square
static int SEE(const int sq, const int side, S_BOARD *pos) {
int SEEValue = 0;
int piece = pos->pieces[sq];
int move = leastValuableAttacker(sq, side, pos);
if (move) {
MakeMove(pos, move);
SEEValue = MAX(0, PieceVal[piece] - SEE(sq, side ^ 1, pos));
TakeMove(pos);
}
return SEEValue;
}
// evaluate the static exchange value of a capture move
int SEECapture(int move, S_BOARD *pos) {
int captureValue = 0;
int capturedPiece = pos->pieces[TOSQ(move)];
MakeMove(pos, move);
captureValue = PieceVal[capturedPiece] - SEE(TOSQ(move), side ^ 1, pos);
TakeMove(pos);
return captureValue;
}
