Author: Sune Fischer
Date: 15:42:30 07/14/03
Go up one level in this thread
On July 14, 2003 at 18:26:52, Gerd Isenberg wrote: >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. You've lost me here :) How does anding with 0x7eh multiply index by 2, what has it got to do with the index? Anyway, perhaps I should have been more clear, here is the one attack macro: #define AttackL45(s,o) (BishopL45[s][((o)>>ShiftL45[s])&63]) It's the ShiftL45 lookup I'd like to avoid, that transformation is not so easy. I thought maybe there was a magic trick :) -S. >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.