Author: John Stoneham
Date: 06:44:36 11/03/98
Go up one level in this thread
On November 02, 1998 at 21:45:05, Robert Hyatt wrote: >a couple of tricks... > >1. you can use square&56 as the shift amount for the 90 degree rotated bit map, >since that will get you exactly the right shift count for any rank... > >2. you may use a bishop shift value, but you can get away by always using 8 >bits from the rotated diagonal bitmaps, if you simply set up the array so that >the "unused bits" still produce the right answer. This avoids having a >different mask for each diagonal length... The reason I pre-calculate even the simple shift and mask amounts, is that I believe an operation such as ((bitboard & mask[sq]) >> shift[sq]) is probably faster than, for example, ((bitboard >> (sq & 56)) & 0x00ff). I may be wrong, and I should probably set up a simple test program to see what the actual differnce is.
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.