Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Fast check detection in bitboard engine

Author: Robert Hyatt

Date: 12:38:43 12/10/03

Go up one level in this thread


On December 10, 2003 at 12:54:13, Romang Jean-Francois wrote:

>Hello,
>
>Is there a fast technique to detect that a king is in check in a bitboard engine
>? In my engine I generate all capture moves and try them to see if the king can
>be captured...but this seems very slow !

Do it backward.  Find the king.  Ask does a knight on this square attack
a square that contains a knight?  If so that knight is checking the king.
Repeat for all your different piece types.


>
>I use check detection mainly in two parts of the engine :
>- During move generation to avoid generating illegal moves
>- To activate check extensions
>
>Is there a way to avoid check detection during move generation ?

Don't do it.  When you go to the next ply, and you capture a king there,
return a special score to the previous ply that says "that move was
illegal, unmake it and try something else."

>
>Thank you :)
>Jean-Francois



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