Chessmate allows itself to be mated if it sees a counter-mate in one or two moves, e.g.:

A simple solution would be to double the value of its own king, but a better design should incorporate a test for checkmate in every position. I fear this may significantly slow down the evaluation function.
Chessmate allows itself to be mated if it sees a counter-mate in one or two moves, e.g.:

A simple solution would be to double the value of its own king, but a better design should incorporate a test for checkmate in every position. I fear this may significantly slow down the evaluation function.