8
\$\begingroup\$

If a program prints out null bytes and those null bytes are not part of the specification, does this disqualify the program although these bytes are unreadable?

||||||
\$\endgroup\$
20
\$\begingroup\$

Yes

When a challenge states to output a specific sequence of bytes (such as Hello, World!), outputting anything else than that exact sequence of bytes is failing to meet the challenge specification. If you can encode the required output in a (pre-existing) encoding such that it matches the output of the submission (comparing raw bytes), it's valid.

||||||
\$\endgroup\$
  • \$\begingroup\$ Unless you can say you are using other encoding. \$\endgroup\$ – Qwertiy Jun 28 '16 at 12:06
  • \$\begingroup\$ @Qwertiy The encoding doesn't matter very much. If you produce an output that is not exactly the same as the required output, it's not valid. Byte-level comparisons just make it easier - encode the output and the requirement in the same encoding, and compare the bytes. \$\endgroup\$ – Mego Jun 28 '16 at 23:46
  • 8
    \$\begingroup\$ If I have to output Hello, World!, but the real output as a byte sequence is "\0H\0e\0l\0l\0o\0,\0 \0W\0o\0r\0l\0d\0!" I can say that it is Hello, World! in UTF16. If it is saved to file and then opend, it is exactly valid result. But \0Hello, World! wouldn't be valid as there is no encoding we can look it in to match the required text. \$\endgroup\$ – Qwertiy Jun 29 '16 at 4:20
  • \$\begingroup\$ @Qwertiy Precisely. That still is covered by this answer. Like I said, if you can encode the required output in a (pre-existing) encoding such that it matches the output of the submission (byte comparison), it's valid. \$\endgroup\$ – Mego Jun 29 '16 at 4:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .