Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Sticks and Stones idea to reduce # of BITS for storing chess positions

Author: Daniel Karlsson

Date: 15:15:45 10/27/99

Go up one level in this thread


On October 27, 1999 at 11:34:22, KarinsDad wrote:

>
>Next problem. How do you differentiate between a knight 010 and a queen 0101?
>How do you know whether the pattern 0101 is a white knight followed by a black
>piece or a white queen?
>

Perhaps this is not needed. Just out of curiosity i tried this:

_: 0
P: 1
N: 00
B: 01
R: 10
Q: 11
K: 000

The back rank in the opening, RNBQKBNR, is encoded to 10000111000010010. Now,
knowing there are 8 squares on each rank, a simple back-tracking algorithm comes
up with the following possibilities:
1 PKBQKBNR
2 RNBQKBNR
3 RKPQKBNR
4 RKQPKBNR
5 RKQRNBNR
6 RKQRKPNR
7 RKQRKR_R
8 RKQRKRB_

We then add which one of the above combinations is the correct one to the code.
I.e. "is it 1? no!", "is it 2? yes!"

The encoded row would then become 10000111000010010:01. Of course some
additional bits are needed to indicate end-of-row, color, etc. And some bits
could be saved by a better algorithm (no pawns on 1st and 8th, never two
adjacent kings, etc).

Is it worth investigating further?



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.