Code-Golf scoring without need to print all in one line

Often great answers in code-golf questions are too hard to read. Also the counting of bytes or characters should just count all characters not including white space. With all the great golfers here, let's some script ideas for scoring so every answer is counted the same but the answers can still be posted in a well-formatted style.

  • 8
    \$\begingroup\$ I don't think that being hard to read is a real problem. \$\endgroup\$
    – Rainbolt
    Jun 26, 2014 at 19:52

2 Answers 2


Whitespace should be counted. If it wouldn't be, this rule could be abused easily, by using the language Whitespace or by using a space as a variable name (this is possible in Golfscript!).

Instead of doing this, it would be better if golfers provide a ungolfed version of their code (in addition to their golfed code), with proper indentation.

  • 5
    \$\begingroup\$ There was recently the other abuse, where someone encoded his entire solution in a string of whitespace characters, added a quick decoder and called eval on it. \$\endgroup\$ Jun 26, 2014 at 23:41

I have always encouraged people to post an ungolfed version of their program alongside (i.e., in addition to, not instead of) the golfed version, to enable slightly easier reading by humans.

  • The golfed version still needs to squeeze all unnecessary spaces out, use single-character identifiers, etc., and is the version used for scoring.
  • The ungolfed version is simply a more readable version of the golfed version, with standard indentation and good identifier names. The ungolfed code must be identical to the golfed version in every other way.

You must log in to answer this question.

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