Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: about in_check()

Author: Russell Reagan

Date: 20:57:41 06/14/03

Go up one level in this thread


On June 14, 2003 at 19:34:12, Magoo wrote:

>"Maybe it is possible not to check for check at all and just check if a capture
>removes the king one ply later."
>
>Yes this is possible, but as i discoverd its really slow, in the early stages of
>my program i did just what you say. The thing is if you are going to do a search
>to depth D, you are really doing a search to depth D+1, which is much much
>slower than doing a search to depth D and calling in_check() after each move.

I think if you use the "capture the king" method of detecting illegal moves, you
have to sort the move list first, and put "captures of the king" at the very
top. Then if your program moves a piece that was pinned (exposing the king,
illegal), the very first next move you will search will be the capture of the
king. So you only visit one extra node, not one extra ply. If you don't sort the
illegal moves to the top of your legal move list, then you will do a LOT of
searching before you find the illegal move, and your program will probably be
slow.



This page took 0 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.