Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: check detection

Author: Inmann Werner

Date: 09:22:01 08/21/99

Go up one level in this thread


On August 20, 1999 at 22:59:51, Peter McKenzie wrote:

>On August 20, 1999 at 21:47:01, Scott Gasch wrote:
><snip>
>>though.  Here's my thought -- usually we should be looking at normal positions
>>where the king is tucked away safely in the corner and not in the middle of the
>>board.  In such positions the InCheck routine that shoots rays out from the
>>king's position to look for threats run quickly.  Since to two sides are the
>>board edges and hopefully we have some blocking pawns in front the code can come
>>back after just checking a few places.  I.e. optimally 8 squares plus 2 for
>>knights attacking = 10.  If I were to run down the piece list for all 16
>>(possible) opponent pieces and compare square relationships to my king and look
>>for blockers... well, I think this would be more work.  What do others think?
>
>You can optimise this alot by taking into account the previous move.  For
>example, if the previous move wasn't a knight move (or a promotion) then clearly
>you can't be in check by a knight so you don't need to scan for knight checks.
>
>For linear pieces you basically only need to scan in the direction of the from
>and to squares of the last moved piece.

Good idea, I have to try!
But it only works, if the oponent moves. To check, if my move is illegeal, it
does not work. So you need two different check evaluation routines.
Is this right?

Werner

>
>>
>>
>>Scott



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.