
International Congress of Psychology, Nauka, Moscow A Computer Model of Checkmating Behaviour in Chess. AFIPS Joint Computer Conferences, reprinted in Herbert A. SP-2150, System Development Corporation, Santa Monica, Calif. » Mater 6, reprinted 1988 in Computer Chess Compendium » Mate-in-two Chess Problems, Compositions and Studies.In case of distant checks, interposing a piece between the threatening sliding piece and the king.

Despite, most programs (should be) are aware of check in advance, and use special move generator(s) if in check or even in double check: At the latest, if no legal move was found, programs need the information whether the king is in check to decide about checkmate or stalemate score. Some programs rely on pseudo-legal move generation, and find Checkmate if all those moves are in fact illegal after making and finding the "refutation" of capturing the king. An alternative approach, not only related to mate scores was proposed by Harm Geert Muller, The Delay Penalty as implemented in Micro-Max. However, those scores need ply-adjustment if stored as exact score inside the transposition table, and re-adjustment if retrieving from TT. Inside a negamax based search, most programs assign VALUE_MATED + ply distance to the root as worst case score if entering a node, which if propagated as mate score along the Principal Variation to the root, translates in mate in odd plies (positive values), or getting mated in even plies. Note that using SHRT_MIN instead of SHRT_MIN/2 as mate value has issues in greater/less comparisons of additive expressions, where summands around SHRT_MIN or SHRT_MAX may under- or overflow, which has somehow relaxed with the advent of the usual 32-bit sign-extension. Inside a 16-bit short integer range, assuming centipawn evaluation, it translates to roughly being 16 queens down.

It is quite common and sufficient to use something like this in C, C++: At the root the score of a mated player is the worst score one can get, that is a negative score with the greatest absolute value of the score range.
