Comments on Default Rules: Code Golf Answer Types
Parent
Default Rules: Code Golf Answer Types
When answering a code-golf challenge, what types of answer are acceptable by default? Can an answer be a complete program, a function, an anonymous function, a snippet of code?
Please add one type per answer. An answer can express that a particular type is acceptable, or that it is not acceptable. Since voting up and down on answers will indicate community consensus, edge cases for particular languages or unusual circumstances can be added as separate answers.
A snippet is not a valid answe …
3mo ago
Anonymous function A code gol …
3mo ago
Function Score is the bytes o …
3mo ago
Complete program A code golf …
3mo ago
Post
A snippet is not a valid answer
A code golf answer must in general be able to take input[1] and give output. A snippet of code that is not contained in a function or program cannot take input[2], instead requiring the input value to be inserted directly into the code. This is not an acceptable type of answer, with the exception of programming languages for which there is no other way to take input.
This reflects the insertion into the source code rule from Default Rules: Code Golf I/O.
-
Some challenges require no input, such as some random output challenges or kolmogorov-complexity challenges. In such cases I would expect the "snippet" to work as a complete program, so these don't seem applicable here. ↩︎
-
If a "snippet" takes input from STDIN, I would expect it to work as a complete program, so that doesn't seem applicable here. ↩︎
0 comment threads