Linked Questions

5 votes
3 answers

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 ...
trichoplax is on Codidact now's user avatar
6 votes
2 answers

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 ...
totallyhuman's user avatar
  • 17.2k
3 votes
2 answers

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 ...
moinudin's user avatar
  • 12.7k
5 votes
2 answers

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,...
Yahel's user avatar
  • 150
10 votes
1 answer

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 ...
FlipTack's user avatar
  • 14.7k
4 votes
1 answer

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 ...
user avatar
-1 votes
2 answers

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 ...
iBug's user avatar
  • 2,691
6 votes
1 answer

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: ...
No Name's user avatar
  • 101
10 votes
1 answer

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 ...
George Menoutis's user avatar
1 vote
1 answer

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 ...
Luna's user avatar
  • 1,806
7 votes
0 answers

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 ...
Esolanging Fruit's user avatar
2 votes
1 answer

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 <...
Dom Hastings's user avatar
  • 23.5k
3 votes
0 answers

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 ...
dan04's user avatar
  • 6,591
0 votes
1 answer

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 ...
Stephen's user avatar
  • 13.8k
0 votes
0 answers

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 ...
DJMcMayhem's user avatar
  • 59.2k
0 votes
0 answers

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/...
cleblanc's user avatar
  • 3,470
0 votes
0 answers

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 ...
Rohan Jhunjhunwala's user avatar
572 votes
5k answers

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 ...
Sandbox's user avatar
424 votes
54 answers

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 ...
102 votes
49 answers

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 ...
trichoplax is on Codidact now's user avatar
37 votes
15 answers

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

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 ...
Martin Ender's user avatar
22 votes
12 answers

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 ...
orlp's user avatar
  • 39.1k
34 votes
8 answers

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 ...
Doorknob's user avatar
  • 71.5k
34 votes
6 answers

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 ...
Martin Ender's user avatar
14 votes
16 answers

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 ...
caird coinheringaahin g's user avatar
20 votes
2 answers

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 ...
Erik the Outgolfer's user avatar
18 votes
6 answers

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
33 votes
3 answers

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

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: ...
Geobits's user avatar
  • 19.7k
15 votes
7 answers

Default policy for output in decision problems

Challenges tagged as decision-problem involve "deciding whether the input meets certain criteria". Although some challenges with this tag involve more than two categories, most involve only ...
Luis Mendo's user avatar
  • 105k
27 votes
2 answers

How does this site work?

Hello, I have spent time looking at the StackExchange sites and especially this has seemed quite interesting to me. But I would like you to explain how it works and what it is about. I know how to ...
ESCM's user avatar
  • 101
28 votes
3 answers

Do function submissions have to be reusable?

Simple question: if I answer a code golf with a function (for a task which is supposed to terminate), does the function actually have to be reusable? Or could it, say, modify some globals which break ...
Martin Ender's user avatar
11 votes
5 answers

Why are some users so quick to jump on a bandwagon?

I've been lurking on this site long before I made my account, and I've seen many cases where people are downvoted simply because they post an answer in the same language as someone else and it happens ...
AdamS's user avatar
  • 325
24 votes
3 answers

Should submissions be allowed to exit with an error?

Suppose we have the following Python code: f=lambda x:x*2 X The first line defines a function which doubles a number. Then the second line is reached, is found ...
Sp3000's user avatar
  • 61.9k
21 votes
7 answers

Challenge post-mortems

While to-be-posted challenges get feedback in the Sandbox (ideally), we don't usually reflect on challenges after they have run. And while issues and ambiguities in challenges do get pointed out, we ...
xnor's user avatar
  • 145k
9 votes
5 answers

When to allow flexible input/output

First, I hope this isn't a duplicate (I've tried my best to search through for similar questions, but I very well may have overlooked one). In the spirit of being fair to inflexible programming ...
cole's user avatar
  • 3,996
9 votes
6 answers

List input in C and length argument

When dealing with list input in C, as in this question, is it acceptable to add extra argument to indicate the length of the list? It does give advantages because other language needs functions like <...
Keyu Gan's user avatar
  • 2,163
15 votes
5 answers

New First-Time Asker Dialog

This revision has been submitted to the devs to push the change, so unless there are any critical issues, this is the final version and I will not be modifying it anymore. (I have cut down the post ...
hyper-neutrino's user avatar
  • 42.4k
18 votes
3 answers

Should we disallow non-observable requirements?

One of the more recent things to avoid that's coming up a lot is the use of non-observable requirements. The most common incarnations of this are things like "no hardcoding", "implement this algorithm"...
Martin Ender's user avatar
16 votes
3 answers

Is the empty string an acceptable decimal representation of 0?

In a recent question for which the correct output for 1 is zero, an answer output ; i.e, nothing. Is this an acceptable base-10 ...
lirtosiast's user avatar
  • 21.5k
23 votes
3 answers

What details should always be given for a code golf task?

Related: For Code Golf, how do you deal with languages without a traditional print/echo statements? Related: What programming language should we consider for the code-golf solution ? Related: Use of ...
17 votes
2 answers

Can numeric input/output be in the form of byte values?

This answer just prompted a question, which I've wondered about a few times when answering challenges in esoteric languages: For some esoteric languages, the only means of input/output is reading and ...
Martin Ender's user avatar
9 votes
2 answers

Should the standard loophole meta thread have the featured tag?

Almost all of our challenges on PPCG have the implied rule of no standard loopholes. However, I have seen many answers (mainly from new users) that contain some of these standard loopholes. Should we ...
GamrCorps's user avatar
  • 7,582
24 votes
3 answers

Is this an acceptable way to shave a byte in ES6?

Say there's a challenge with two inputs. Can we submit a function signature like this? a=>b=>... Instead of ...
Patrick Roberts's user avatar
11 votes
4 answers

What even is a "function" by our standards?

On a recent question, the following was brought up by @Sp3000: In fact, I'm almost starting to wonder what a "function" is, since it seems like every language with goto could define a "function" ...
Addison Crump's user avatar
23 votes
3 answers

Should we start "reviving" older challenges?

Related. Earlier today, AdmBorkBork posted this question on TNB, asking whether or not PPCG was dying. In the following discussion, I have suggested we, as a community, could start "reviving" (for ...
J. Sallé's user avatar
  • 3,453
12 votes
2 answers

Does Baba Is You belong here?

Introduction Baba Is You is a puzzle game. In this game, a level is a grid that consists of objects and texts, and the objective of the level is to, if there are texts ...
Dannyu NDos's user avatar
  • 5,941
8 votes
5 answers

Can a Prolog predicate have multiple choice points if it always chooses the correct solution first?

This stems from JoKing's answer to Sums of Consecutive Integers, where it can be seen that the predicate always unifies Z with the correct answer first. However, ...
Razetime's user avatar
  • 27.2k
41 votes
1 answer

CGCC Blog Post #2: The history of PPCG and CGCC

We recently turned 10 years old. Unfortunately, we didn't really realise and therefore didn't really celebrate or even mark the occasion. But, it got me thinking about the history of the site, and now ...
caird coinheringaahin g's user avatar

15 30 50 per page