Computer Chess Club Archives


Search

Terms

Messages

Subject: To MR Wegner, more explanation. Thanks a lot.

Author: Maurizio Di Vitto

Date: 09:10:47 12/17/03


Dear Mr Werner,
I woul like to receive some explanation about your last code:

unsigned char tstate;
int x;
for (square = 0; square < 64; square++)
{
    for (state = 0; state < 256; state++)
    {
        for (x = square, tstate = mask[File(square)]; !(tstate & (state ^
mask[File(square)]); )
                            //this for loop should also check that x does not
                         //cross over the edges of the board
        {
            x += 7;
            tstate >>= 1;
            attacksr45 |= mask[x];
        }
        //repeat for other direction
    }
}
//repeat for other diagonal

tstate should be a 8 bit value, It’s supposed to represent a rotated diagonal,
the max length is eight squares. I’d like to know more about
tstate=mask[File(square)] and !(tstate & (state ^
mask[File(square)]);.
Thanks again.

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.