One of the downsides of doing client-side code golf is that it’s really easy to cheat. It’s so easy that most people would find it really boring. But if you’re not deterred by boredom, golf.js has a simple safeguard in place: all scores are submitted with code, and any code found to break the rules will be deleted.
Which raises the question: what exactly are the rules? Here they are:
- jQuery is legal. I’m loading jQuery for the functionality of the site itself, but you’re welcome to use it in your submitted code.
- Using any other external JavaScript (e.g. via AJAX, script tag insertion, bookmarklets, etc.) is not legal.
- ObscureVariableName is not legal. I’m using this suffix in the testing framework itself to avoid conflicts with your own variable names. So don’t intentionally introduce such conflicts to game the game.
That’s it so far. If necessary, I’ll add more rules as I see people doing things that could reasonably be labeled “cheating.” And some holes may include exceptions to these rules.
The Scoring
The scoring is pretty simple:
- Incomplete holes get a default score of 10,000.
- Complete holes get a score equal to the number of characters in the solution code.
If you have questions about rules or scoring, speak up.