Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Thoughts about board representations...

Author: Andrew Williams

Date: 04:02:52 02/11/00

Go up one level in this thread


On February 11, 2000 at 04:18:08, Tom Kerrigan wrote:

>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


In my piecelist array, W Pawns are always 0-7, W Pieces are 8-15 (K always 15).
B Pawns are 16-23, B Pieces are 24-31 (K always 31). I don't condense my lists
when pieces come off and when Pawns promote the Queen record simply replaces
the appropriate Pawn record. I don't condense because that would screw up my
attack boards, but I have considered condensing at the start of every search,
because then I can change all the attack records and the board records and
not do it too often. I wonder how much of a speed advantage a condensed
piecelist is? Anyone got any experience of condensed vs uncondensed?

If I was going to do this, I'd just force a gap in the middle. Pawns would
always start at the front, pieces would always start at the back. There'd be
a gap in between and you could put your promoted pieces (or pawns when you
unmake a promotion) there.


Andrew



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.