Author: Gerd Isenberg
Date: 00:26:23 02/28/06
Go up one level in this thread
On February 27, 2006 at 22:39:49, Randall Shane wrote:
>On February 26, 2006 at 07:39:10, Gerd Isenberg wrote:
>
>> If you try to do you own "research" here is the already posted but
>> slightly optimized De Bruijn class for you:
>
>Gerd,
>You mentioned in a later message that this De Bruijn class had a bug -- what is
>it?
>
>Thanks!
Not the class but the output of the generated table, the mask-bitboards in
http://www.talkchess.com/forums/1/message.html?489837
because i need the outer potential occupied squares masked with zero to fold the
up to six bits into a 64-bit range. The algorithm was implemented correctly, but
i did printf the wrong bitboard:
instead of the wrong masks
// little endian mapping
SMagicMask mm[64][4] = {
{ // from a1
{ // noEastsoWest
0x8040201008040200, // should be 0x0040201008040200
0x0210b0530d448201,
},{ // soEastnoWest
0x0000000000000000, // zero diagonal don't cares
0x0218a392cd3d5dbf,
},{ // _North_South
0x0101010101010100, // should be 0x0101010101010100
0x020a80064ee0bf79,
},{ // _East__West_
0x00000000000000fe, // should be 0x000000000000007e
0x02049f12cd3159af,
}
},.....
With the corrected table you can address the "rotated"-like attack maps with
and,mul,shift:
BitBoard preCalulatedAttacks[64][4][64];
struct SMagicMask {
BitBoard mask;
BitBoard magic;
};
occIdx64 = (occupiedBB & mm[sq][dir].mask) * mm[sq][dir].magic) >> 58;
attacks = preCalulatedAttacks[sq][dir][occIdx64];
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.