Author: Gerd Isenberg
Date: 13:04:13 02/26/06
Go up one level in this thread
Applying the old trick - not using the outer squares of the masked occupied ray - makes perfect 6-bit range hashing possible. Most often there are only 32 occupied states per ray - only if the source is an outer square, there are 64 states on a eight square ray: BitBoard preCalulatedAttacks[64][4][64]; struct SMagicMask { BitBoard mask; BitBoard magic; }; // sq ::= 0..63 square index of a sliding piece // dir ::= 0..3 kind of ray (two diagonals, horicontal, vertical) occIdx64 = (occupiedBB & mm[sq][dir].mask) * mm[sq][dir].magic) >> 58; attacks = preCalulatedAttacks[sq][dir][occIdx64]; Generated mm-values below in a separate longer post...
This page took 0.01 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.