Author: Gerd Isenberg
Date: 15:26:52 07/14/03
Go up one level in this thread
On July 14, 2003 at 17:59:36, Sune Fischer wrote: >On July 14, 2003 at 17:52:06, Gerd Isenberg wrote: > >Hi Gerd > >I was just wondering, you wouldn't happen to know an easy transformation for the >diagonals, so that a table lookup for ths shift could be avoided? > Hi Sune, Not necessary to shift the masked occupied state, only a question of indexing diagonals and byte aligned access (interprete the rotated occupied bitboards as an 8-byte array). Pack the longest diagonal (a1-h8) one in one byte, then length 7 (b1-h7) with opposite length 1 (a8-a8), 6 (c1-h6) with 2 (a7-b8) and so on. Look for an 8-ray index calculated with rank and file indicies of these square. Except calculating the ray index and the tables of course, diagonal lookup code is the same as for ranks or files. >Somehow that shift bothers me, it should be possible to compute it on the fly I >think. > >-S. "and" with 0x7eh and you have index * 2. So shifting may be avoided due to 4 multiplier in address calculation. Regards, Gerd
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.