Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Position Storage

Author: Toni

Date: 09:43:17 12/23/03

Go up one level in this thread


On December 23, 2003 at 00:15:44, Robert Hyatt wrote:

>On December 22, 2003 at 23:39:08, KarinsDad wrote:
>
>>What structure do people use in their programs to store a position?
>
>
>A chess board -> a position?
>
>12 bit boards, one for each piece type.
>
>An array of 64 elements (or more) one for each square.
>
>In theory you could define a position as a 32 element array, one for each
>possible piece, telling what the piece is and what square it is on.  But this
>has not been used in a _long_ time so far as I know, as it is too slow to deal
>with.
>
>I'm sure you could create others.  But probably none would be any better than
>one of the first two I mentioned.

Just to add something: Some engines (including crafty I guess) use BOTH
representations. in this way you can use the good features of each one. You can,
for instance know which piece is to be taken with a move by looking to the 64
element array, and you can generate push pawn poves efficiently with the
bitboards. Note that the size of the position structure is not important.

Regards





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.