choroba,
I have tried to respond to your post multiple times but apparently the Monastery isn't what it used to be.

See Chess StackExchange for a similar question.

Thanks. Apparently prior art is 24 bytes and doesn't include as much information as my 23 bytes BUT my 23 bytes is inadequate as explained by ikegami elsewhere in this thread.

I can't clearly see why you need 8 bytes to represent the positions of white or black pieces

You have 64 squares and a maximum of 32 pieces. I am trying to compress that in the smallest possible space possible. I use 8 bytes to tell you which of the 64 squares are occupied by white pieces. This is done using a bitstring where the value is either 0 or 1 (piece there or not). I do the same for the black pieces. Once I have told you which spaces are occupied by white pieces, I no longer need to distinguish between white and black - I can simply tell you what piece is at each position. There are 6 different possibilities (pawn/rook/knight/bishop/queen/king). I can do that using 3 bits since 2^3 = 8. Hopefully that now makes sense.

Cheers - L~R


In reply to Re^2: [OT] Is It Possible To Serialize A Chess Board In Fewer Than 23 Bytes? by Limbic~Region
in thread [OT] Is It Possible To Serialize A Chess Board In Fewer Than 23 Bytes? by Limbic~Region

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.