Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: KD's 20 byte thing

Author: KarinsDad

Date: 15:11:31 08/17/99

Go up one level in this thread


On August 17, 1999 at 15:40:06, Michel Langeveld wrote:

>>2) Storing the location of each piece. This is the typical 64 square for king
>>#1, 63 squares for king #2, 63 squares for piece #3 (including off the board),
>>62 for piece #4, etc.
>
>What about for example a promoted pawn to a knight which is on E4?

If the two original knights for that side exist, then it gets stored as a pawn
with a knight promotion state at location e4. Normally, with this type of
algorithm, all of the main pieces (i.e. not pawns) are handled first. This
allows a promoted knight to be replaced via an original knight if an original
knight is off the board (there is no difference between a position with an
original knight and an off board pawn; and a position with a promoted knight and
an off board original knight).

Hence, the reason the pawns need state information.

>
>As far as I can tell, there is no easy way to compress
>>this type of data nor is there an easy way to derive it. The problem I see with
>>this type of schema is that is allows the storage of a lot of illegal positions.
>>Hence, if it does achieve a maximum number of positions greater than 2^160, it
>>would be difficult (not impossible) to re-use those illegal positions by
>>changing the algorithm. For example, if the opposing queen is checking our king
>>and it is the opposing side to move, those positions would be dropped from the
>>number of positions possible for the opposing queen. The same with if two
>>knights are checking a king simultaneously or if the kings are right next to
>>each other, etc. But pulling out the illegal positions would be tough since you
>>have to know which are legal and which illegal and that information may not be
>>available due to interposing pieces that have not yet been "placed" on the
>>board. Also, one would have to come up with a way to represent the pawns in one
>>of 5 states.
>
>White's pawn on A2 can be on (white-out promotion):
>A3, A4, A5, A6, A7 = 5
>B3, B4, B5, B6, B7 = 5
>    C4, C5, C6, C7 = 4
>        D5, D6, D7 = 3
>            E6, E6 = 2
>                F7 = 1 +
>                    ---
>                     20 states

Yes, but the algorithm already takes into account the location of the pawn. In
the case of the a pawn, it is 21 maximum locations (not states) in the not
promoted state. The 5 states are: not promoted, promoted to rook, bishop,
knight, or queen.

And, of course, other state information like castling and en passant must also
be added.

KarinsDad :)

>
>This algorithm probably works. But, proving it may be extremely
>>difficult (especially if the illegal positions bump the count above 2^160).
>
>I think you 're right with this.
>>



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.