Hacker News new | ask | show | jobs
by antsou 1010 days ago
I believe you can also do it in a slightly different way. For each square on the board:

0 - encodes no piece in the square; at least 32 of them, so 32 bits (4 bytes)

1xxxx - xxxx being your encoding: encodes remaining pieces; at most 32 of them, so max 32 x 5 bits (20 bytes)