Questions tagged [output]
The output tag has no summary.
16 questions
13 votes
1 answer
215 views
Policy on Outputting Irrationals as Fractions
There's consensus that answering with fractions is allowable for decimals that can be expressed as fractions. But what about irrational numbers? Can they be expressed as a rational representation of ...
1 vote
1 answer
183 views
Is returning a longer array allowed?
There exist some questions that it's easier to output an array longer than intended to output, and it costs to slice. Longer array behave like small ones as long as you don't access its length or out-...
11 votes
0 answers
303 views
May I return more results than specified?
I'm golfing in Lua, which does support such thing as multiple return values like this: ...
3 votes
1 answer
75 views
Where timing between outputs matters, does the solution need to account for buffering?
In certain languages (i.e. C), writes to streams like stdout can be buffered by default - what this means is that when one calls functions like ...
5 votes
3 answers
345 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 ...
9 votes
1 answer
197 views
Can we expect out arguments to be allocated?
According to this consensus in the default allowed inputs thread, functions may output by writing to an out argument. When outputting an array in languages like C/C++, where arrays are pointers to ...
2 votes
1 answer
210 views
Can I use CBMC (a static verification tool for C) for code-golf?
So with the recent maze challenge I had the idea to implement a solution using CBMC (home / source), which is a tool that statically verifies C code and can produce counter-examples for property ...
7 votes
2 answers
234 views
Does output count if part of it scrolls off the screen?
Let's consider a QBasic solution to FizzBuzz. The code works correctly, printing the required output from 1 all the way up. The problem is, since there's a lot of ...
5 votes
3 answers
191 views
Is (consistently) swapping truthy / falsy values allowed in decision-problems? [duplicate]
I couldn't find any consensus on this on meta for a while, and this seems to be particularly helpful when answering decision-problem challenges. Should swapping truthy and falsy be allowed by default, ...
-1 votes
2 answers
195 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 ...
13 votes
2 answers
358 views
Output in reversible languages
A reversible language is a programming language where no operation is capable of destroying information. That means that with the output and a program you can always determine the input provided. ...
4 votes
1 answer
159 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 ...
6 votes
3 answers
344 views
Can Halting be considered output?
I am currently designing a language that cannot halt unless it all of its memory is cleared, this means for any practical application it has no output whatsoever. However when the program does halt ...
1 vote
1 answer
75 views
Are we allowed to copy the output of the code to the clipboard?
Asking for a friend... For "Hello, World!", you can save an extra 1 byte by using copy("Hello, World"). However, I am confused on if it's allowed for your ...
1 vote
0 answers
55 views
Backspace Character In output [duplicate]
If a program outputs some string. And then deletes part of the string with the backspace character (in java "\b"). And procedes to print the rest to spec. Would this be considered a violation?