Computer Chess Club Archives


Search

Terms

Messages

Subject: Detecting stalemate with a pseudo-legal movegenerator?

Author: Frederik Tack

Date: 16:13:06 11/11/05


A few months ago, i started writing a chess engine in Delphi. I chose to use a
pseudo-legal movegenerator for performance reasons. In order to detect a
checkmate, i just check if the king is captured and this works fine. I'm now
trying to figure out how to detect a stalemate, but i haven't found an easy way
to do this yet. The problem is that when the king is captured, the program is
already two plies deeper in the search tree then the node where a possible
stalemate could have happened.
So far, the best idea i have come up with is the following : In opening or
mid-game positions, the chances of a stalemate are pretty much non-existing. So
for opening and mid-game, i can use the pseudo-legal move generator without a
problem. For end-games, i could switch to a legal move generator. The only
difficulty here is to find to best moment in game to switch to the legal move
generator.
I wonder if any1 else has had the same problem and found an easy way to detect
stalemates with a pseudo-legal move generator? If so, any suggestion would be
most welcome.






This page took 0.07 seconds to execute

Last modified: Thu, 15 Apr 21 08:11:13 -0700

Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.