Author: Michel Langeveld
Date: 12:40:06 08/17/99
Go up one level in this thread
>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?
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
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.
>
>3) Using a bitboard for the location of pieces and a set of bits to describe the
>piece. This is what I am attempting to do. I am using basic algorithms discussed
>here on this forum, but adding in a bunch of rules which compress it. For
>example, if there are less than 2 pawns on the board, then you do not need an
>en-passant bit. Or, if you have encountered 16 pieces of one color, then the
>color bit for all future pieces is the other color (I do not use this particular
>rule since it does not work for all cases, but I wanted to give an example of
>the kind of compressions due to knowledge at hand that could be done).
>
>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.