Before I discovered that code golf was "a thing", I'd played against myself quite a bit. Often, I'd get down to 104 characters, say, and crank on it until I could get it to 100. But, if I can't get it below 90, I like to get it back to 100, 'cause it's nice and round. I deem this "code shuffleboard".
The idea behind code shuffleboard is to implement an algorithm in exactly a certain number of bytes. Of course, it's trivial to inflate a golfed solution by adding whitespace, using longer variable names, etc. So, the rules would be:
- No unnecessary whitespace
- All variable / function names (if applicable to your language) defined in the code must be 1 letter (unless you run out of letters, then you can use 2-letter variables)
- No comments
- No useless code: deleting anything from the program must break it
In short, every character must contribute nontrivially to the functionality of the program.
Would other people participate in this? For a twist, one could require that the code fit inside of a certain sized rectangle, with no room to spare (though, that would risk favoring J/GS overly much).
x=y/z+1-1
seems to me to contain some code which isn't dead but is completely useless. \$\endgroup\$$
that's$5-
, but if the variable isx
it has to bex 5-
to avoid the variable name being lexed asx5
. \$\endgroup\$for(x=10000;x<100010;x++)print x-10000
, though it probably should. \$\endgroup\$(a*a*a)*(a*a*a)
and claiming removing them breaks the code because of floating point precision. \$\endgroup\$