Skip to main content
46 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
42 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 '...
38 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
  • 69.2k
38 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
38 votes
Accepted

What are our specific abbreviations and terms?

See also Stack Exchange Glossary - Dictionary of Commonly-Used Terms. Abbreviations marked with a star (*) are chat specific. ATO: Attempt This Online; a website similiar to TIO where newer versions ...
33 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.5k
33 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.5k
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
28 votes

Default for Code Golf: Input/Output methods

Multiple arguments to a function can be taken as a list or tuple instead For example, if you needed to take in two integers as arguments, you can take one argument: a list of both integers. Apparently,...
The Thonnu's user avatar
  • 18.3k
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
  • 78.4k
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
26 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
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,286
25 votes

Things to avoid when writing challenges

Hidden pattern in the output for code golf challenges You should not post a challenge in which an essential part is to find a pattern in the required output, which is not stated in the challenge but ...
Luis Mendo's user avatar
  • 105k
23 votes

Loopholes that are forbidden by default

Using cryptographic functions in a cops and robbers challenge Almost every cops and robbers challenge will have the following requirement: Using cryptographic functions such as hashes or PRNGs is ...
22 votes

Loopholes that are forbidden by default

Using an inconsistent I/O format to encode information For example, for a hypothetical challenge where the output could only ever be two or eleven, submitting the python program ...
22 votes

Things to avoid when writing challenges

Using old challenges as a model Just because an old challenge did something doesn't mean yours should too. Many old challenges wouldn't pass muster nowadays. Don't be surprised if your challenge is ...
xnor's user avatar
  • 147k
22 votes

Things to avoid when writing challenges

Excessively long back stories This is a site for people who like programming challenges. They already want to see your idea for a challenge. You don't need a back story to make your challenge appeal ...
trichoplax is on Codidact now's user avatar
21 votes

Loopholes that are forbidden by default

Exactly duplicating another answer This specifically came up for me in a king-of-the-hill contest. In particular, this contest had a random component, so replicating a submission could allow one to ...
21 votes

Default for Code Golf: Input/Output methods

black-box functions to be taken as input can be passed as an argument This holds for functional languages or languanges that do have first class functions/anonymous functions/lambda functions or ...
flawr's user avatar
  • 43.9k
21 votes

Default for Code Golf: Input/Output methods

You may assume that the input is valid When parsing an input, you may assume that the input is already valid. You are not required to validate it unless the challenge is specifically about testing ...
Xwtek's user avatar
  • 2,039
20 votes

Default for Code Golf: Input/Output methods

Functions may return a function that returns the result This is very similar to currying, the only difference being that only the first call includes an argument. Sometimes it's useful to curry a ...
ETHproductions's user avatar
20 votes

Loopholes that are forbidden by default

Sidestepping in a theorem-proving challenge A theorem-proving challenge is about proving a statement (= constructing a value of the given type) given in a specific host language (designed for theorem ...

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