Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Extending Checks

Author: Gian-Carlo Pascutto

Date: 02:35:37 09/12/04

Go up one level in this thread


On September 10, 2004 at 21:35:58, Stuart Cracraft wrote:

>How do people get around the cost
>of determining that there is only
>1 legal move?
>
>For me, that's an expensive operation
>involving usually dozens of makemove/unmakemove's
>with a test to see if the king is attacked,
>at every single node, before doing the search
>of the 1 move with the increased depth.
>
>Only rarely is it just 1 legal move to get
>out of check. But the determination of that
>is not rare. It has to be done for every
>sweep of the moves at each node.

I didn't see anyone hint at this rather simple solution which, in my experience,
works perfectly fine:

1) if not in check, assume you have > 1 legal move and don't bother testing
anything at all

2) if in check, just do the slow check of all moves. You can stop as soon as you
see 2 legal moves, so generally only a few moves have to be tried.

Case (2) is seldom enough that you should not slow down noticeably at all
because of this.

--
GCP



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.