Author: Russell Reagan
Date: 12:57:50 03/24/04
Go up one level in this thread
On March 24, 2004 at 15:23:26, Dann Corbit wrote:
>A lot of people seem to use the 16x8 board with 0x88.
>
>Very vew people seem to use the other half for anything useful.
>
>I am wondering, does anyone use the other half of the board to store data about
>the square it duplicates?
>
>Seems like a very obvious enhancement to me.
When I have used 0x88-like approaches, the board is an array of pointers to
piece structs, so I can add whatever I need to the piece struct. The size of the
struct doesn't matter. I only shorten it after an actual game move has been made
(not after every search move, which is something I would also like to try, but
then the piece struct cannot be much bigger than 32-bits). An example of what I
might do:
struct Piece
{
int color;
int type;
int square;
int status; // captured?
};
Piece * board[256];
// Only one of the following
Piece piece_list[2][16]; // [color][index]
Piece * piece_list[2][6]; // [color][type][index]
The other approach is to have the board be an array of piece values and have an
array of occupied squares. I like to scan the piece lists so I use pointers.
Something like this:
int board[256];
int occupied[2][16]; // index of an occupied square [color][index]
I think that using the other half of the board would only be useful if you used
and approach where the size of the piece information mattered. For instance, in
the first approach if I shortened the piece list after every capture in the
search, I wouldn't want to copy around big structs. In the second approach, you
don't want to copy around a lot of piece info either so you are limited to
32-bits (or whatever the CPU register width is).
What are your thoughts? How might you use the other half of the board?
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.