6 ms·
If the goal is to be as compact as possible, I think we could say that a board is read in a very specific order, always the same, that a single bit at 0 is an e
by Zababa 4y ago
If the goal is to be as compact as possible, I think we could say that a board is read in a very specific order, always the same, that a single bit at 0 is an empty square, and that a bit at 1 starts a block of 4 bits that encode a single piece.
And maybe there's a way to reduce that even more, by allowing different ways of reading through the board, and trying to use that to order the pieces so that we can use less bits for encoding them. For example, if the board starts with 0 it's a regular pattern of doing line A, 1 to 8, then line B, etc, but if it starts with 1 we read it as a spiral, so A1 to A8 to H8 to H1 to B2. And maybe this way we can at least find a place where two of the same pieces are following each other and we can organize everything so that for each piece that is the same as the one before we can only use a single bit at 1.
You can probably go much deeper than that, but it's already a fun start.