Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Fast check detection in bitboard engine

Author: Frank Phillips

Date: 10:10:23 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 !
>
>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 ?
>
>Thank you :)
>Jean-Francois

You can have a function that detects whether a particular square (eg the one the
king is on) is attacked.

If you have attack tables this is trivial (I think).

Otherwise you can save time compared to your normal movegen routine by screening
out quickly pieces that could not possibly attack the square eg because they are
not on the diagonal, file, or rank that the square (king) is on - in the case of
sliders.  (knights and pawns are trivial with bitboards of course.).


Frank



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.