Computer Chess Club Archives


Search

Terms

Messages

Subject: Thanks a lot to Mr Wegner. Doubt

Author: Maurizio Di Vitto

Date: 07:30:19 12/05/03


I want to thanks Mr Wegner for all the explnation. I have two questions.
It was about the initialization of rank_file[64][256].
(your code)
UINT64 o, m;
int x, y;
for (x = 0; x < 64; x++)
{
    for (y = 0; y < 256; y++)
    {
        o = y << (x & ~7);/*same as y << (8 * (x / 8))*/
        rankattacks[x][y] = 0;
        m = mask[x];
        while (m && !(m & o))
        {
            m <<= 1;
            rankattacks[x][y] |= m;
        }
        m = mask[x];
        while (m && !(m & o))
        {
            m >>= 1;
            rankattacks[x][y] |= m;
        }
    }


If the state is 0, the bitboard o will be ...... 00000000, so the operation m<<1
or m>>1 will continue until the bitboard finish because m&o will be equal to
zero, should I control if I reach the end of the rank(or file)? It seems to be a
stupid question.

I red your explanation about the file_attack[64][256]. To do that I used a
bitboard called keep_value where I'll memorize the state (in your code is o)
with a shift operation, then I initialized the file_attacks[square][state]=0,
m=mask[rotated90r[square]], and then

int up=8;

while(m & (m&keep_value)==0)
{
m>>1;
file_attacks[square][state]|=mask[square+up];<--/*in this part I receive an*/
up+=8                                           /*access violation error*/
}
...........
is it a right way and should I control the end of the rank or file?
Thanks o lot for your time.
Maurizio Di Vitto.



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.