Computer Chess Club Archives


Search

Terms

Messages

Subject: Extracting information from rotated Bitboards

Author: John Stoneham

Date: 14:58:06 11/02/98


In my program GrimReaper, I use a simple function consisting of a pre-calculated
mask value and a pre-calculated shift value (more pertinent to diagonal
rotations, but still usefull to the 90 degree rotation) to extract the 8-bit
code necessary for accessing the (again) pre-calculated attacked squares for the
given rotation (Queen/Rook or Queen/Bishop). Obviously, for unrotated
orientations, or 90 degree rotations, the masks and shifts are simple. But
diagonals are more complicated, and the use of an array of precalulated shifts
and masks for the given orentation seems necessary. Since these are calculated
before the engine is started, it seems simple to calculate the 90 degree shifts
and masks as well. Then all you need is a ((Bitboard & mask) << shift) type of
routine to get the 8-bit has value, regarless of the rotation. (More information
on my routines is available in my GrimReaper journal at
www.geocities.com/SiliconValley/Lab/4714/index.html). Does any handle this
calculation differently?



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