Author: Sune Fischer
Date: 02:26:34 06/25/02
Go up one level in this thread
On June 24, 2002 at 20:33:32, Russell Reagan wrote:
>I am not an experienced bitboard user. I've been thinking about trying them out
>just to see how they work in comparison with my current 0x88 implementation. Is
>there any potential problem in mixing the two approaches? One problem that I can
>see would be that if you have an index for a bitboard, it's not going to index
>into the same square in your 0x88 array. I suppose the only real reason to keep
>0x88 would be for efficient edge detection. Do bitboards offer a solution to
>edge detection? Or do they even need edge detection when using bitboards (ex.
>using the BSF asm instuction would seem to avoid edge detection altogheter)?
>
>Thanks,
>Russell
For edge detection you can do this:
if (((uint64)1<<square)&0xFF818181818181FF)
...
it will tell you when you are on the first and last file or rank.
I use that in my SEE to raytrace behind the attacking piece, something like
while (!(((uint64)1<<square)&0xFF818181818181FF)) {
square+=direction;
if (there-is-an-attacker-on-square)
add-it-to-the-list-of-attackers
}
-S.
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.