Author: Dan Newman
Date: 16:59:40 07/07/98
Go up one level in this thread
What I've been doing recently (last couple of years) is to make the board an array of pointers to piece--this makes it quite easy (and fast) to find the piece. That is I usually have something like this: int piece[2][16]; int *board[64]; and set the board pointers to NULL for empty squares and to the elements of the piece list for the occupied squares. (I usually use an 0x88 style board with 120 elements though.) Also, I typically store the coordinate, piece type, color, and a "captured" bit in the piece. The "captured" bit allows me to skip over captured pieces during move generation inside the search. At the start of a search, I can trim out the captured piece if any to shorten the list--but I don't do this inside the search. -Dan.
This page took 0.02 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.