Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Further Correction: This one was obscure, but cool!

Author: KarinsDad

Date: 16:21:29 05/14/99

Go up one level in this thread


On May 14, 1999 at 18:33:35, Eugene Nalimov wrote:

>If en-passant is possible, you can encode positions of 2 pawns into 14 different
>values. Then you can store '0' at the corresponding squares of the board. Naive
>encoding is:
>000 (3 bits) - no EP possible,
>xxxx (4 bits, not starting from 000) - one of the 14 possible configurations.
>This way you use extra 1 bit on EP square, but save 2*2 bits on the board.
>
>Eugene
>

Eugene,

Ok, let me get this straight.

You have a 3 bit EP flag. If it is not 000, it is really 4 bits. This I do not
understand, I would think that there are 20 possible configurations, not 14, and
it would require 5 bits. Otherwise, you would need to still have the 3 bits for
the last pushed pawn location, so you went from 4 bit EP (1 bit indicator, 3 bit
location) to either 3 (without EP) or 5 (with EP).

The associated square in the structure would not need anything in it (not a
single bit) since you know that square has a taking pawn it it or not (if it
did, it showed up in the configuration). This means that you would save 4 bits
here if you had one possible EP take and 8 bits if you had two.

The bottom line:

Without EP, you have saved 1 bit on the EP flag.

With EP, you have added 1 bit (the 5 bit EP flag vs. the 4 bit EP flag and
location), but either saved 4 (1 EP possible) or 8 bits (2 EPs possible) for a
net result of either 3 bits or 7 bits.

Very nice. 0 EP, save 1 bit. 1 EP, save 3 bits. 2 EP, save 7 bits.

I hope this is what you meant. We had 2 differences, you thought the
configuration could fit in 4 bits whereas I thought 5 and you thought that a bit
would be needed in the structure and I did not.

KarinsDad :)




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.