Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Minimum bits for chess board representation?

Author: Larry Griffiths

Date: 17:03:02 09/29/00

Go up one level in this thread


On September 29, 2000 at 19:11:17, Bo Sjögren wrote:

>Some time ago, maybe a year or so, there was an interesting
>discussing about the minimum number of bits necessary to store an
>arbitrary chess position. What was the conclusion of the
>discussion? Can I find the discussion in the archive, or a
>summary somewhere on the net?
>
>Regards,
>Bo S

I store mine in 32 bytes (256 bits). Each 4 bits contains the piece and its
color as follows...

cppp

where c is the color and ppp is the piece (could have up to 8 piece types).

OR

If you really like to pack bits you could have a fixed array of 6 bits times 32
bits (192 bits) where each of the 32 buckets has the square the piece is setting
on.
The problem with this second arrangement is that you would need another 8
buckets for each side (32*6bits+16*6bits=288 bits) if promotions occurred.

Neither of these arrangements include bytes to hold the en-passant status of the
board or castleing state.

Larry.




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.