Computer Chess Club Archives


Search

Terms

Messages

Subject: more squishy bits ideas to hold all possible board positions

Author: Dann Corbit

Date: 18:13:16 10/19/99

Go up one level in this thread


Here's a sort of RLL notion...
If the first bit in a sequence is zero, then the square is blank.  Else,
interpret the next five bits as follows:
10000 - black king
11000 - white king (white to move)
11111 - white king (black to move)
10001 - black queen
11001 - white queen
10010 - black rook
11010 - white rook
10011 - black rook (may castle)
11011 - white rook (may castle)
10100 - black knight
11100 - white knight
10101 - black bishop
11110 - white bishop
10110 - black pawn
11110 - white pawn
10111 - en passant pawn

There will be a maximum of 32 five bit sequences and 32 1 bit sequences.  When
the board has fewer pieces, the size will quickly drop off.
It seems a clever person should be able to reduce it much further.
Consider:
8/8/5k2/8/3P4/2K5/8/8 w - -

This would be coded as {in binary and separating bits for clarity}:
00000000 {8 blank squares}
00000000 {8 blank squares}
000001000000 {5 blank squares, black king, 2 blank squares}
000111100000 {3 blank squares, white pawn, 4 blanks squares}
001100000000 {2 blank squares, white king (wtm), 5 blank squares}
00000000 {8 blank squares}
00000000 {8 blank squares}

This particular position consumes only 68 bits.


For this (opening) position:
rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq -
we would have:
1001110100101011000110000101011010010011 {black r(c)nbqkbnr(c)}
1011010110101101011010110101101011010110 {black pppppppp}
00000000 {8 blank squares}
00000000 {8 blank squares}
00000000 {8 blank squares}
00000000 {8 blank squares}
1111011110111101111011110111101111011110 {white pppppppp}
1101111100111101100111000111001110011011 {white r(c)nbqk(wtm)bnr(c)}
Which is 5*8*4 + 8*4 = 192 bits

I think it can be squished further by taking advantage of additional information
and using a different encoding for the pieces (not sure how yet) but by
combining the two ideas (rll + q/a) maybe we can get a really small board
depiction.




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.