|
|
|
|
|
by thrw21
886 days ago
|
|
After some more thinking and feedback: 2 bits per square
00 empty
01 white pawn
10 black pawn
11 other piece
=128 bits
4 bit index of white king on board (one of the others)4 bit index of black king for each "other piece" on board that is not a king: 1 bit color + 2 bit type 1 bit for current player 2 bits for each king if they moved (optional, only exists if king is at thair initial square. Otherwise it is moved) 1 bit for each pawn if they can be captured en passant (optional, these bits only exists for their pawns if there is a pawn at 4th row for white or 5th row for black) (And i will ignore the draw rule) |
|
Notice that this alone is more than a lot of positions with my "naive" implementation - 36 bits per side for the best case, with only the king, and at most one queen: 6b for the king, 6 bits for the queen, or its absence, 6 bits each for the absent rooks, bishops, knights and pawns.