Skip to main content
59 votes

Things to avoid when writing challenges

Requiring minimum scores In short, don't post a code golf that says "Your code has to be shorter than 100 bytes" (the same applies to any other winning criterion). The usual motivation is that the ...
Martin Ender's user avatar
59 votes
Accepted

When can APL characters be counted as 1 byte each?

GNU APL and ngn/apl use UTF-8, so use a byte counting tool. NARS2000 only uses UCS-2, so 2 bytes per character. IBM's APL2 is the only modern APL that natively supports APL EBCDIC, so 1 byte per ...
Adám's user avatar
  • 30.3k
52 votes

Things to avoid when writing challenges

Non-observable program requirements The validity of a program should depend on things that can be observed when the program is treated as a black box. Examples are data written to standard output or ...
feersum's user avatar
  • 31.4k
52 votes

Things to avoid when writing challenges

Don't allow / ask for different things in languages with different capabilities Don't write specs like "Do X. If your language doesn't support X, you can do Y instead". Examples are: Do some math in ...
nimi's user avatar
  • 35.8k
45 votes

Things to avoid when writing challenges

Saying you should produce one or several outputs randomly without further specification One random output Say someone writes a challenge about generating a labyrinth of a given size (width and height) ...
Luis Mendo's user avatar
  • 105k
41 votes

Loopholes that are forbidden by default

URL shorteners / shortened URLs Every once in a while, we get a challenge that requires fetching some data from the internet. While some of them manage to ban URL shorteners in time, other don't. I ...
38 votes

Loopholes that are forbidden by default

When consistent and distinct values are asked as input, you cannot input complete or partial functions When I create a challenge and ask for a boolean or two '...
37 votes

Things to avoid when writing challenges

Allowing standard loopholes in general Don't say "Standard loopholes are allowed". They ban silly things like making up a language where the solution is a single character or just printing the string ...
xnor's user avatar
  • 145k
37 votes

Things to avoid when writing challenges

The prime numbers We have 226 questions about prime numbers at the time of writing. Almost every single one of these involves some adaptation of the “canonical prime checking code” or the “canonical ...
lynn's user avatar
  • 68.7k
37 votes

Things to avoid when writing challenges

Formulating the challenge as something and then including a twist that completely changes the task Don't hide information from the reader. Don't enounce the challenge as something that later on it ...
Luis Mendo's user avatar
  • 105k
35 votes

Loopholes that are forbidden by default

Outputting an expression instead of a number For example, outputting 3*3 instead of 9, or outputting ...
35 votes

Things to avoid when writing challenges

Adding unnecessary fluff See also: Chameleon challenges, Cumbersome I/O formats, Do X without Y What's the main point of the challenge? Try to keep the challenge to just that. Don't go adding frills ...
Sp3000's user avatar
  • 61.8k
33 votes

Things to avoid when writing challenges

Patching out approaches On your challenge, someone posts a solution that's cheap and not at all what you intended. You have the option to change the rules, but do so very carefully as there's many ...
xnor's user avatar
  • 145k
32 votes

Default for Code Golf: Input/Output methods

In languages without any method of input (e.g. ///) programs may get input through an insertion into the source code
boboquack's user avatar
  • 2,317
32 votes

Loopholes that are forbidden by default

Improper quines We've reached consensus on what counts as a proper quine over a year ago, yet the occasional "quine" that consists of nothing more than literals and/or NOPs still comes up. ...
32 votes

Things to avoid when writing challenges

Input Validation This is a subset of adding special cases for completeness that seems to come up pretty often. From a given set of possible inputs, a solution shouldn't have to sort out inputs that ...
Jo King's user avatar
  • 47.2k
31 votes

Default for Code Golf: Input/Output methods

Submissions may use list of strings instead of multi-line strings Input or output may be the equivalent of the string separated by newlines. For example, the multiline string: ...
Jo King's user avatar
  • 47.2k
27 votes

Default for Code Golf: Input/Output methods

Full programs may take array/string input (of unknown length) via stdin in the form of <length> <contents> or ...
Bubbler's user avatar
  • 76.7k
26 votes

Default for Code Golf: Input/Output methods

Functions may return their result in an optional type wrapper Relevant meta discussion. By "optional type wrapper" I mean something like Maybe a in Haskell, ...
Esolanging Fruit's user avatar
25 votes

Default for Code Golf: Input/Output methods

An array may be represented in input as a pointer and length. For example in C you could use: int f(int*p,int l){...}
MegaTom's user avatar
  • 4,256
25 votes

Default for Code Golf: Input/Output methods

I/O for sequence questions may either be 0-indexed or 1-indexed Any sequence question that has the user output the \$n\$th term, first \$n\$ terms, etc. of a sequence should allow programs to index ...
lirtosiast's user avatar
  • 21.5k

Only top scored, non community-wiki answers of a minimum length are eligible