Skip to main content

Questions tagged [code-golf]

For questions about code golf challenges and/or submissions. DO NOT post code golf challenges themselves as questions here; those belong on the main site or in the Sandbox if you want to get feedback on them.

Filter by
Sorted by
Tagged with
10 votes
5 answers
829 views

Ruleset for RGS's Golfing Showdown - competition is over!

RGS RGS stands for RGS's Golfing Showdown, a golfing competition. The competition has ended, final leaderboard at the end of this post! 1 - The format The RGS will be a virtual golfing competition ...
RGS's user avatar
  • 14.1k
9 votes
1 answer
420 views

Are languages targeting FPGAs or other non-standard/non-sequential computing platforms acceptable?

So far, almost all submissions on this site are ones that target "standard" computers, namely devices that execute code in a typically linear fashion, with a standard variety of inputs/outputs (...
nanofarad's user avatar
  • 288
9 votes
1 answer
398 views

Scoring Java lambdas with imports [duplicate]

In this answer, I used a java.util.List as a parameter to an anonymous function (lambda) answer. So, my question is, Should this import be counted to the byte ...
CAD97's user avatar
  • 1,337
8 votes
1 answer
314 views

What is the consensus on built ins?

Originally on this challenge I banned built in matrix functions but people complained about it. I then removed the ban but there were few interesting answers given and some people complained and said ...
Beta Decay's user avatar
  • 23.4k
8 votes
4 answers
673 views

Minecraft I/O Methods

Seeing as how we've discussed a size measurement for Minecraft redstone creations, I thought I'd follow that up with establishing standard output and input methods. Minecraft, obviously, does not ...
a spaghetto's user avatar
  • 11.2k
5 votes
2 answers
400 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,...
Yahel's user avatar
  • 150
5 votes
3 answers
217 views

Should golf questions be a CW and why?

I thought CW was for making only 1 answer per language, but on SO I saw again and again, that question had two or more answers of the same language. Should we keep CW-checkbox tradition? If it needs ...
Nakilon's user avatar
  • 643
5 votes
3 answers
368 views

How should we score compiler/interpreter build-time options?

Prompted by this comment. The scoring of optional flags passed to compilers/interpreters has already been handled here and here. However there is another case of one more level of indirection. ...
Digital Trauma's user avatar
5 votes
6 answers
308 views

Tips for writing good code golf questions

I think the code-golf tag wiki doesn't have enough on writing a good code golf question. I'd like to collect advice on these, and perhaps the most well-liked can be incorporated. What makes a code-...
xnor's user avatar
  • 145k
5 votes
1 answer
339 views

Do we accept submissions in unimplementable languages?

I recently posted a code-golf answer in Scheme-1. However, the Scheme-1 language cannot be implemented (as it would require the implementation to solve the halting problem). I marked it as non-...
Esolanging Fruit's user avatar
5 votes
1 answer
399 views

should imports/includes count in golf [duplicate]

follow the title mainly I'm asking this so I know whether to count all the import declarations that are required for the code to run successfully (especially when the import/include is required in ...
ratchet freak's user avatar
5 votes
3 answers
174 views

Accepting numeric inputs in mixed decimal and unary bases

There seems to be agreement that numeric input is by default accepted in either decimal or unary bases. The linked meta-question doesn't address the issue of whether separate inputs of the same ...
Luis Mendo's user avatar
  • 105k
4 votes
2 answers
288 views

Is using external decompression legitimate golfing?

The 12 Days of Christmas Lyrics challenge has several solutions of the form "Use an external decompression utility on this file to create a solution.language file, then execute the decompressed file." ...
AShelly's user avatar
  • 4,651
4 votes
1 answer
366 views

How do we count compiler/interpreter flags? [duplicate]

It's accepted practice to include non-standard compiler or interpreter flags in a program's byte count (most often used with Perl and Ruby, to run the program in an implicit I/O loop - but there are ...
Martin Ender's user avatar
4 votes
3 answers
223 views

Do I need to count the newline for Vitsy methods?

Background: Methods in Vitsy are defined by specific indices of lines of code. For example, if I wanted to call the second line of a program, I would call 1m to ...
Addison Crump's user avatar
3 votes
2 answers
382 views

How should the length of a Commodore 64 BASIC program be measured?

Commodore 64 BASIC has abbreviated forms for most of its keywords, ranging from ? being short for PRINT (common across many ...
Mark's user avatar
  • 2,395
3 votes
2 answers
329 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 ...
moinudin's user avatar
  • 12.7k
2 votes
2 answers
114 views

Multiple functions without leading/trailing mandatory parts?

Are we allowed to have multiple functions without the verbose Func-parts which are calling each other as code-golf submission? For example, in Java 8+ this is an allowed answer based on the current ...
Kevin Cruijssen's user avatar
2 votes
2 answers
368 views

Code golf answers that aren't golfing attempts

This answer clearly wasn't golfed, but is still a valid solution to the problem. How should we handle such answers? Should we down-vote them for being long? Should a mod delete them for being off-...
moinudin's user avatar
  • 12.7k
1 vote
5 answers
441 views

Proposal of new measure for "byte count" in code golf

Byte count is the default winning criterion in code golf. Counting bytes (as opposed to characters) is reasonable, because a language that uses more characters needs more bytes to define them. ...
Luis Mendo's user avatar
  • 105k
24 votes
1 answer
827 views

Introducing a New Golf Language

So over the past week I've developed Just Another Interpreted Stack-Base Language (JAISBaL for short), and I had a few questions: Is there any reason JAISBaL would be illegal to use for the general <...
Socratic Phoenix's user avatar
16 votes
1 answer
480 views

On using multiple languages for a singular code golf submission

I was wondering if it were possible to use multiple languages in the same submission. Not a polyglot, but using each of the languages. I have two thoughts on this. One language invokes the other. Let'...
Conor O'Brien's user avatar
16 votes
4 answers
494 views

Should answers have to handle invalid inputs?

I'm trying to get advice on how to make my challenges better. One rule that I feel like I'm always specifying is what to do when an invalid input is given. There's really two main paradigms to take ...
DJMcMayhem's user avatar
  • 59.3k
15 votes
3 answers
336 views

Can a C submission be in the form of a macro defined by command line argument?

In this question, the current C solution is f(n){n=n?:1;} Obviously this command line is shorter by 2 bytes: -Df(n)=n?:1 ...
l4m2's user avatar
  • 24.5k
15 votes
1 answer
411 views

If a challenge is difficult, can I provide a completely non-golfed answer?

Let's say I have a challenge that is difficult. Indeed, people may believe it to be impossible, since it is somewhat obscure. Should I provide a completely non-golfed answer, sort of as a hint, to ...
Christopher King's user avatar
15 votes
4 answers
725 views

Are newbies allowed to write programs in golf languages?

I'm afraid that languages like CJam are reserved for pro golfers. I think about that because I get the impression that answers in languages like CJam just need to be accepted.
Xwtek's user avatar
  • 2,039
15 votes
2 answers
350 views

Defaults for reading several pieces of input

When reading several pieces of input as command-line arguments, it is common practice to read each piece as a different argument. The command-line arguments now provide an array of the input pieces. ...
Dennis's user avatar
  • 210k
14 votes
5 answers
528 views

Remove number of characters from answers, if it's not a CG-question

I like to encourage people, to remove the number of characters from answers, given for questions, which are not code golf. Example: Here is a recent question which isn't a codegolf, which has 8 ...
user unknown's user avatar
  • 4,591
13 votes
2 answers
444 views

How to count programs in Folders?

Folders is an esoteric programming language without any files at all. Instead, the program is represented by the directory structure instead, so our normal rules for counting the file size of the ...
Martin Ender's user avatar
13 votes
3 answers
1k views

Huffman Encoded Golfing Language

Here's have an idea, which may save millions of bytes to golfers out there. But I'm not sure it's good. Take a language that's good for Golfing (e.g. Pyth). Take all existing CodeGolf answers in this ...
ugoren's user avatar
  • 17.5k
12 votes
3 answers
668 views

What do we rename Advent of Code Golf?

Recently, Seggan received an email from Eric Wastl, the owner of Advent of Code, part of which is quoted below: Please do not call your event something like "Advent of Code Golf"; this ...
Ginger's user avatar
  • 5,660
12 votes
5 answers
441 views

Potential execution flag rule break

I am currently developing a golfing language for a specific type of task. I was hoping to use some command line flags for different options in the language. Since the language is intended to be a ...
Wheat Wizard's user avatar
  • 98.8k
11 votes
5 answers
231 views

Should locale be explicitly specified?

Triggered by this comment. Some code-golf answers assume a specific locale. For example this answer assumes a locale of en_US.UTF-8. If the default locale on a ...
Digital Trauma's user avatar
10 votes
4 answers
310 views

Answers still marked as "non-competing"

The community has decided that answers in newer languages can now compete in code-golf (they were previously required to be marked as non-competing). However, now and then I will still come across an ...
Esolanging Fruit's user avatar
10 votes
2 answers
320 views

How to count bytes in languages with autoformatters [duplicate]

In QBasic, VBA, AppleScript, etc., there is an autoformatter that adds spaces and expands some syntactic sugar. For example, if I type this code: ?x*2 QBasic ...
DLosc's user avatar
  • 39.7k
9 votes
5 answers
583 views

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
  • 4,006
9 votes
2 answers
350 views

Dumping the output as an answer

Sometimes, on kolmogorov-complexity challenges with a constant output, we get extremely boring answers that make absolutely no effort to compress the output whatsoever, and instead just literally dump ...
DJMcMayhem's user avatar
  • 59.3k
8 votes
1 answer
213 views

Specific Languages

In the Code Golf Overflow, can your answers be written in any language unless otherwise specified by the OP? Or do they have to be written in any specific language?
Evan Manning's user avatar
8 votes
4 answers
304 views

Metadata for answers?

It would be great to have an option in answers to add metadata. (This would be most useful for questions tagged code-golf, but maybe also other tags?) You would be able to put in the language, the ...
user avatar
7 votes
2 answers
335 views

ECMAScript 6 and potential related flags

I know that compiler flags (such as -D for C/C++) are counted towards byte count, but what about interpreter flags? How would those affect byte count? Given that ...
Claudia's user avatar
  • 1,690
7 votes
1 answer
153 views

Are multi-language submissions allowed?

I'm not talking about, Here's a part of a solution in CJam, and here's the other half in Javalanguage, you figure it out I'm talking about, my language is really simplistic and can't read more ...
cat's user avatar
  • 5,909
7 votes
1 answer
267 views

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

This is kind of a follow-up to / re-asking of "Should point-free function expressions be allowed when a function is asked for?" with specific reference to the only language I know how to golf in, j, ...
algorithmshark's user avatar
6 votes
1 answer
257 views

On byte count and language preprocessing [duplicate]

Related: Fair size comparison across languages with different source alphabets Scoring non-ASCII languages in code-golf has been long-debated. Since I primarily uses APL for code golf, I have seen ...
TwiNight's user avatar
  • 4,800
5 votes
10 answers
281 views

Methods of counting characters on various systems

Counting characters of a program manually is tedious, and we do this a lot in Code Golf. How do you do a more effective character count using utilities provided by your shell or ide?
moinudin's user avatar
  • 12.7k
5 votes
2 answers
264 views

Same language different version for polyglots [duplicate]

I recently answered a polyglot challenge (my answer is here). I'm using Python 2 and Python 3, abusing the floor division of py2. However, a commenter asked me if using the same language but ...
user avatar
5 votes
1 answer
359 views

Choosing outputs for challenges

When the program you write for a challenge writes/outputs to multiple of the default outputs, are you, the answerer allowed to state which one is counted for the purposes for the challenge? For ...
Blue's user avatar
  • 28.6k
5 votes
4 answers
384 views

Define new languages?

Can I define some new languages, to be used in future code golfs? For example, CG-VB.NET would be a language which is equivalent to itself as VB.NET code, but wrapped in: ...
Ry-'s user avatar
  • 5,363
3 votes
2 answers
273 views

Can I redo the Solve Rubik's Cube challenge?

The challenge Solve Rubik's cube has a lot of flaws: Arbitrary limits: (say, max. 5 seconds on your machine and less than 1000 moves) Cumbersome input format: The input is in the format ...
MD XF's user avatar
  • 13.9k
3 votes
1 answer
355 views

C/C++ golfing: Should undefined behaviour be allowed? [duplicate]

This question on SO raised some comments about using undefined behaviour in C/C++ golfing. Should we require that solutions follow the standard? If we do, we could promote down-voting of solutions ...
moinudin's user avatar
  • 12.7k
2 votes
5 answers
294 views

Code Golf Scoreboards

Throughout all of PPCG, we can find questions relating to the tag code-golf. Unfortunately, finding the lowest byte answer for questions can be difficult if not frustrating without an automatic system ...
Addison Crump's user avatar