Hot answers tagged

49 votes
Accepted

Should answers have to handle invalid inputs?

No, invalid inputs may result in undefined behavior Requiring input validation only adds extraneous code to the answer and takes away from the challenge.
user avatar
  • 28.4k
34 votes
Accepted

What does "taking no input" mean for a program?

Programs may assume that input is empty I believe that the requirement The program has to ignore the standard input, that is, it should work regardless of what is given as input. is too strong. ...
user avatar
32 votes
Accepted

How should vim answers be scored?

vim answers can be run from the command line as such: ...
user avatar
  • 70.5k
32 votes

A proposal to combat Meta Bloat™: The Big Consensus Freeze

I propose that each commonly-used language have a separate explanation of the rules that most pertain to it, with code examples. I think this is more digestible that a big general FAQ, especially to ...
user avatar
  • 137k
31 votes
Accepted

Case Sensitive Strings

Unless specified otherwise, strings are case-sensitive. More generally, unless specified otherwise, strings are just sequences of characters with no semantics attached to any specific characters. ...
user avatar
28 votes
Accepted

Are compiler-specific submissions allowed?

Yes, on PPCG a language is defined by its implementation. In case your program is not portable you should specify the interpreter or compiler.
user avatar
  • 38.7k
23 votes
Accepted

Can I write a golfing library?

Yes, and it does not necessarily have to be a separate language. There's no problem with using your own library as long as it doesn't violate the standard loopholes. In answers where you use it, you ...
user avatar
  • 30.9k
22 votes

Are Mathematica's datasets valid?

I do consider them built-ins. Just because you sort of have to update your language (or language's standard library) before you can use them for the first time, doesn't mean you're fetching the result ...
user avatar
20 votes
Accepted

When is it allowable to change the rules?

I have created this very complex infographic; I hope my hours of effort will solve this problem. The only possible exception is if the answer in question is exhibiting one or more obvious loopholes ...
user avatar
  • 70.5k
20 votes

Is this language allowed?

... could you just use common sense? If you seriously actually need an enumeration of why exactly this is invalid (which I doubt): you need to provide a working, freely available interpreter, which ...
user avatar
  • 70.5k
19 votes

Should language-specific code golf challenges be explicitly disallowed?

No (with caveats) -- Language-specific challenges are on-topic Challenge authors are allowed to add other arbitrary restrictions (banning built-ins, banning capital letters, requiring out to be base-...
user avatar
  • 42.8k
17 votes

Should language-specific code golf challenges be explicitly disallowed?

Only allow challenges to restrict languages indirectly via requirements The one good reason for a challenge to restrict languages is that the spec makes sense only for languages with certain features ...
user avatar
  • 137k
17 votes

New users' guides to golfing rules in specific languages

Haskell Basic IO In Haskell, a valid answer is usually a function, unless a full program is required by the challenge. Even if a challenge requires you to output an infinite stream of data (like all ...
17 votes

Are bots allowed in The Nineteenth Byte?

Chat bots (that post messages) have no place in TNB. Since TNB is for discussion of code-golf and PPCG related topics, having bots in the room would be distracting and obnoxious, and would overtake ...
user avatar
16 votes

Default policy for output in decision problems

Truthy/falsy using your language's convention (swapping allowed), or two distinct values to represent true/false respectively You can choose to output truthy/falsy using your language's convention (...
user avatar
  • 62.2k
15 votes
Accepted

Duplicates on other SE sites

Let it be. Codegolf questions on SO get deleted apparently at random, so there's no telling how long that one will be there. However, it might be a good idea to link to it from your question and to ...
user avatar
  • 42.8k
15 votes
Accepted

Codegolf rules and boundaries

Answers that use a language (or a feature thereof) that postdates the challenge should be labeled non-competing. From Can I ever answer with a language invented after the challenge was posted?: These ...
user avatar
  • 206k
15 votes

What outputs should I allow for decision problems?

One consistent, and one non-consistent The thing I like about Truthy and Falsy is that often you may do things like output 0 for falsy and everything else for ...
user avatar
  • 85.1k
15 votes

If we find a programming language in the Library of Babel, can we use it?

The language would have been created on the date at which the book was bookmarked for the first time The Library of Babel is basically an encoding scheme: any possible string will exist somewhere in ...
user avatar
14 votes
Accepted

ECMAScript 6 and potential related flags

I would say no. ECMAScript 6 is sufficiently different from its previous versions that I would consider it a new language. (By the same logic, you could technically say that using C++11 would require ...
user avatar
  • 70.5k
14 votes
Accepted

If your answer is acts differently depending on context, how safe do you have to be?

Our defaults say that submissions have to be full programs or functions. REPL "programs" are also allowed, but they have to be labeled as such, and still have to conform to the defaults regarding ...
user avatar
  • 206k
14 votes

Can We Make 0-NAND OR Gates in [logic-gates] Challenges?

It depends on the question. logic-gates is a tag for challenges about logic gates. It doesn't, and shouldn't, come with special rules like this. If the person that poses the challenge wants that to ...
user avatar
  • 85.1k
13 votes

Should a character encoding that can't actually be used by a compiler/interpreter be allowed?

No People need to be able to actually run your entry. Just as you can't write code with syntax errors, you can't write code that your interpreter won't compile because it's not encoded in a certain ...
user avatar
  • 2,819
13 votes

Should answers have to handle invalid inputs?

By default valid input is guaranteed If it's not, some behaviour should be specified: Any behaviour (but why specify this when it's defeult?) Handle it in some way and produce a specific value ...
user avatar
  • 2,949
13 votes
Accepted

Should graphical-output challenges accept straight up image files by default?

The thing is that not all image formats are created equal. Some are just straightforward uncompressed streams of pixels, and there is basically nothing you can do to golf those down. However if your ...
user avatar
  • 85.1k
12 votes

1 on 1 language mappings "legal"?

As elaborated in the comments, the complete list of rules (which applies to libraries too) of which I am aware are: The language (or library) must have existed prior to the challenge. This is to ...
user avatar
  • 4,827
12 votes

New users' guides to golfing rules in specific languages

Python General I/O Your submission should be a program or a function. It should print the output or return it. These example submissions compute the factorial in Python 2: ...
12 votes
Accepted

If code fails to compile, but runs anyway, does that count as executing without error?

In my opinion, yes. Typically, anything that happens during the compilation stage is ignored. For example, a C/C++ program that produces warnings doesn't make any difference as long the executable ...
user avatar

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