Author: Tom Kerrigan
Date: 14:13:05 07/08/98
Go up one level in this thread
On July 08, 1998 at 14:24:36, Robert Hyatt wrote:
>again, why multiples? just piece_list[48], and have a board that points
>into this list for removing pieces when they get captured... This way,
>you capture pawns and everything the same way...
Consider the case where you want to generate moves for pieces. With the data
structures I suggested, the code looks a little like:
for(i=0;i<piece_count[side_to_move];i++)
generate moves for piece_list[side_to_move][i];
Very simple. With your method, it looks like this:
if(side_to_move==WHITE)
for(i=0;i<last_white_piece;i++)
generate moves for piece_list[i];
else
for(i=16;i<last_black_piece;i++)
generate moves for piece_list[i];
I don't think I care for this sort of division between black and white.
Cheers,
Tom
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.