Linked Questions
101 questions linked to/from Default for Code Golf: Input/Output methods
5
votes
3
answers
246
views
Is a regex answer valid if it gives the reciprocal of the required output? [duplicate]
This answer gives the reciprocal of the required output, rather than the required output itself.
In a simpler challenge this might cut out a significant part of the work, but for this particular ...
6
votes
2
answers
497
views
Is outputting a Maybe acceptable in Haskell? [duplicate]
The vote on this output option has moved here.
Haskell has a very strong type system, so there is a type called Maybe to work around some restrictions.
The ...
3
votes
2
answers
322
views
What input methods should we allow for Code Golfs? [duplicate]
Should we define rules on how input can be fed into programs? This question on SO allowed for any input method, which resulted in answers which ripped off the question by doing the computation in ...
5
votes
2
answers
395
views
For Code Golf, how do you deal with languages without a traditional print/echo statements? [duplicate]
JavaScript comes to mind as a language without a traditional outputting mechanism.
In this instance, document.write() is suggested, but its specific to the browser,...
10
votes
1
answer
272
views
Returning a function, which returns the result? [duplicate]
Submission formats are always flexible here on PPCG. Named functions, anonymous functions or even full programs that perform IO, are all fine.
Even currying is acceptable, for example, taking ...
4
votes
1
answer
123
views
JS Promises in code-golf? [duplicate]
Should code-golf submissions written in JS that return a promise be allowed?
For example:
Promise.resolve("hi")
Doesn't output ...
-1
votes
2
answers
156
views
Should the output to STDERR count as output length? [duplicate]
A few challenges that requires the program to output something at a specified length, and a bunch of answers well... uses built-in error messages that's generated by the interpreter rather than the ...
6
votes
1
answer
187
views
Is Ans considered a valid form of input for TI-BASIC? [duplicate]
We haven't reached a complete consensus on whether or not Ans is permitted as a valid input format for TI-BASIC.
We have this answer on "Default for Code Golf: ...
10
votes
1
answer
213
views
What counts as "output" in SQL? [duplicate]
Some of the site's questions rule that something must (or must not) be printed to the output. My question is, in the case of SQL, what really is the output?
The ...
1
vote
1
answer
185
views
Hard coding input [duplicate]
I've seen some answers that hard code the input or rely on the existence of a user-defined variable, see for example this question. The OP asked for a "function or equivalent subprogram". I don't ...
7
votes
0
answers
195
views
Why can't we take input from a variable? [duplicate]
On the default allowed I/O methods, we have come to a consensus that programs may not take input from a predefined variable.
However, we have decided that anonymous functions are allowed. In the ...
2
votes
1
answer
87
views
When accepting input from STDIN, can it be assumed to terminate with a newline [duplicate]
...or I guess more specifically, can I require that input from STDIN (or closest alternative, e.g. TIO) be newline terminated?
Utilising apps like TIO this isn't added, but if using a terminal with <...
3
votes
0
answers
78
views
What's a number? [duplicate]
Similar to What's a string?
If a challenge says that the input will be “a number”, what data types are acceptable?
Obviously, types like int and ...
0
votes
1
answer
59
views
Do programs need to take input, if it is in the spec? [duplicate]
Recently, there have been some challenges involving the OEIS. Specifically, when given an index as input, the challenge spec involves output the item in the OEIS at that index. However, for constant ...
0
votes
0
answers
58
views
Is it acceptable to take input in two different formats? [duplicate]
This isn't an issue yet, but I could see it become one sometime soon. Can I take input in two, or even more, separate formats, provided they're both reasonable formats? For example, let's say one ...
0
votes
0
answers
54
views
In code-golf is it always ok to print ASCII digits when an integer is asked for? [duplicate]
When the question clearly asks for an integer is it always OK to just print the ASCII digits of the integer without actually generating the integer value?
The consensus is yes. It's the programs/...
0
votes
0
answers
47
views
Clarification of global variables as "arguments" [duplicate]
Say language X supports functions, but input must be done through one of the predefined global variables (all initialized to zero). Can I consider this a use of an argument? Similarly can I use this ...
560
votes
4k
answers
324k
views
Sandbox for Proposed Challenges
This "sandbox" is a place where Code Golf users can get feedback on prospective challenges they wish to post to main. This is useful because writing a clear and fully specified challenge on ...
418
votes
52
answers
211k
views
Loopholes that are forbidden by default
There are a number of standard loopholes which experienced question-setters seek to explicitly close. However, inexperienced question-setters may unintentionally leave them open, or respondents may ...
101
votes
49
answers
25k
views
Things to avoid when writing challenges
If there is something that you find annoying / counterproductive / unfair / detrimental / no longer funny in challenges (question posts), describe it in an answer here, and propose a recommended ...
37
votes
15
answers
3k
views
New users' guides to golfing rules in specific languages
What are the most important rules a first-time golfer in a given language should know? For instance, how do golfed programs usually take input and output?
Each language should have a single CW answer ...
50
votes
6
answers
8k
views
Default for Code Golf: Program, Function or Snippet?
One of the things many (new?) users forget to specify in code-golf challenges is whether the answers should provide a full program or a function (or even just a snippet). For most such things, we have ...
22
votes
12
answers
3k
views
Default acceptable image I/O methods for image related challenges
I do not feel that the default general acceptable I/O methods sufficiently cover image-processing and graphical-output challenges. So I would like to poll.
What are the default acceptable I/O methods ...
33
votes
8
answers
6k
views
Standard definitions of terms within specifications
Quite often I find that I am repeating myself when creating a challenge. For example, usually I have to retype the definition of "random" in all of my posts, or I have to specify the same thing about ...
32
votes
6
answers
3k
views
Can numeric input/output be in unary?
Some string-based languages (including but not limited to sed, Retina, ///) can't really handle integer arithmetic in decimal (or other normal bases). Therefore, these almost always have to start by ...
14
votes
16
answers
798
views
Best of CGCC 2022 - Voting Now Open!
Final phase
You have chosen the categories and the nominees for CGCC's annual "Best of". Now it is time to pick the winners!
Each of the 16 categories is represented by an answer to this ...
18
votes
6
answers
1k
views
Things to consider when creating a challenge
There's a lot to remember to include when writing a challenge for this site. What are some things that are easy to forget?
Return to FAQ index
20
votes
2
answers
4k
views
Command-line flags on front ends
Our standard policy regarding command-line flags states that one should count the space before the dash (-) too, when there aren't any "free" options, since it ...
32
votes
3
answers
6k
views
Welcome to Code Golf and Coding Challenges Stack Exchange!
What is this site?
This is a place to host recreational coding challenges, such as code golf. We are unlike most sites in the Stack Exchange network. We are not a question-answer site, nor are we a ...
21
votes
5
answers
1k
views
What's a string?
If a challenge says that input will be in the form of a string, what is acceptable?
Various languages have different ways of implementing strings, so here's what I've "borrowed" from Wikipedia:
...