Computer Chess Club Archives


Search

Terms

Messages

Subject: Re: Bait taken: *any* pos below 24 bytes..

Author: Andrew Dados

Date: 09:02:37 05/16/99

Go up one level in this thread



On May 16, 1999 at 05:26:03, Dave Gomboc wrote:

>On May 16, 1999 at 02:57:06, KarinsDad wrote:
>
>>On May 15, 1999 at 15:28:56, Dave Gomboc wrote:
>>
>>[snip]
>>>before draw" rule... it took them about 61 moves.  So anyway, yes, please allow
>>>every legal position.
>>
>>Dave,
>>
>>You sound like one of the purists I mentioned before. Tell me it isn't so. :)
>
>Like (I think) most computer programmers, I like stuff that doesn't break in
>weird freaky cases that I have to hunt down at considerable pain and expense.
>Does that make me a purist?
>
>>In order to require all bits in the 25 bytes, the schema that Eugene and I
>>discussed would require that all pawns are off of the board, that there is 12
>>promoted pieces on the board, that all of the original pieces are still on the
>>board and that all pieces are on row 2 through 7. This means that there are 28
>>pieces with no pawn protection within the 48 squares of the middle of the board.
>>It seems a little much, doesn't it.
>
>25 bytes is really annoying.  It might as well be 32 bytes.  24 bytes would be
>much better.  (in-memory alignment issue for array of struct)
[snipped]

    Here we go: yet another schema to minimize _maximal_ neded space...:)
We need 5 pieces (excluding Kings) x 2 colors = 10  bit states
For packing 3 pieces together we need 10^3 = 1000 states, which fits in 2^10 (10
bits)
so for 30 pieces (32- 2 kings) we get 12 bytes 4 bits...

   Now define 'format':
64 bits  piece location bitmap
12 bits for 2  kings indexes and castle status (6 bits per king, first bit
indicates any castle status;  if none then 5 others give [0..31] index of the
king, if any then kings position is known then 2 bits give details on status).
8 bits for 50 move counter+side to move
100 bits for up to 30 pieces 'packed' (see above)
4 bits EP possibility+EP file

   Total gets up to 23 bytes 4 bits worse case, any 3 pieces removed is 10 bits
less....all 32 piece (including 'fantasy') positions fit.
-regards-
 Andrew



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.