Author: Gerd Isenberg
Date: 11:16:14 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 ! yes, the usual way with bitboards is to generate rook and bishop attacks from king's square, as if the king is a queen. If these sets intersect opponent rooks/queens or bishops/queens, the king is checked by a slider. Same with knight attacks and inverse pawn attacks (e.g. ownPawnAttacks(kingsquare) & opponentPawns). I do it in that way, that i explicitely generate checking moves in seperated movegen phases (captures as well as quite checks) and i set an check-flag in my 32-bit move struct. Therefore after making moves, testing that check-flag is enough and may save the above procedure after none checking moves. Gerd > >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
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.