Author: Heiner Marxen
Date: 07:00:09 06/20/02
Go up one level in this thread
On June 20, 2002 at 04:48:49, Russell Reagan wrote:
>As far as I know, this is how the 16x16 board is layed out:
>
>XXXXXXXXXXXXXXXX
>XXXXXXXXXXXXXXXX
>XXXXOOOOOOOOXXXX
>XXXXOOOOOOOOXXXX
>XXXXOOOOOOOOXXXX
>XXXXOOOOOOOOXXXX
>XXXXOOOOOOOOXXXX
>XXXXOOOOOOOOXXXX
>XXXXOOOOOOOOXXXX
>XXXXOOOOOOOOXXXX
>XXXXXXXXXXXXXXXX
>XXXXXXXXXXXXXXXX
>
>The O's are the board, and the X's are the illegal squares. I don't know how
>this differs much from a 12x12, or a 12x10 board, but if Christophe says so,
>then I have no reason to believe it's not true.
I would rather expect:
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXX
OOOOOOOOXXXXXXXX
OOOOOOOOXXXXXXXX
OOOOOOOOXXXXXXXX
OOOOOOOOXXXXXXXX
OOOOOOOOXXXXXXXX
OOOOOOOOXXXXXXXX
OOOOOOOOXXXXXXXX
OOOOOOOOXXXXXXXX
>To test if a square is out of bounds, you would just set the X's to -1 or 0 or
>whatever value you choose to stand for "out of bounds". So you could say:
>
>#define OUT_OF_BOUNDS -1
>
>// ...
>
>if(squares[x][y] != OUT_OF_BOUNDS)
> MakeMove(x,y);
One main aspect of the 0x88 sceme is that you test the _index_
before you even fetch the memory, and detect the outside indices with
a simple test:
if( (index & 0x88) == 0 )
look at valid board[index];
That way the upper 8 ranks need not even be implemented, since they are
simply never accessed.
Just read the explanations from Bruce, they are excellent (as always).
Cheers,
Heiner
>That's pretty simple, but maybe you get the idea. If you just use an 8x8 array,
>you'd have to test more and it would be a little slower. Unless Christophe has
>some secret that none of the rest of us know about, I don't think this is very
>important as long as you choose one that is reasonably efficient.
>
>Russell
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.