Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Thoughts about board representations...

Author: Tom Kerrigan

Date: 01:18:08 02/11/00

Go up one level in this thread


On February 10, 2000 at 20:25:51, Andrew Dados wrote:

> I define a structure:
>{
>piece: piecetype;
>color: colortype;
>index: byte (index into piece list);
>dummy: byte
>}

Keeping the piece list index with the color and type is a really good idea. I
hadn't thought of that.

How do you do your piece lists? I was thinking something along the lines of:

int piece_list[n];
int *first_piece[2];
int *first_pawn[2];
int *last_piece[2];
int *last_pawn[2];

So there are actually 4 lists in the piece_list array. I was also thinking about
making the lists 0-terminated. That way you don't have to know where the list
ends to step through it.

-Tom



This page took 0.01 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.