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
5
votes
0answers
107 views

What exactly is the Criteria for a Function? [duplicate]

I got the idea for this question after reading an answer by Martin Ender here. It more-or-less says: Functions in stack-based languages can leave the output on the stack. This question is also similar ...
-8
votes
1answer
136 views

New code golf format: function contents

This would work like this: A function scaffold is specified containing a variable name You do not need to declare a function or print a value, just use a return statement. Example: Ruby: ...
11
votes
2answers
1k views

Codegolf rules and boundaries

So last time, I was hanging on codegolf, and came across the question Print the digital root, where one guy replied here with a one-byte code. Of course, it takes advantages of the built-in and ...
2
votes
2answers
266 views

How should I submit an anonymous lambda that has a self reference?

In a lot of situations we allow for C# answers to simply be an anonymous lambda with the assumption that to run it it needs to be stored in a variable. So given that, is it acceptable to also assume ...
1
vote
1answer
83 views

How to answer a Code Golf Puzzle [duplicate]

In some languages such as PHP you need to add these <?php ?> before you can start to program in PHP. And in C++ too. ...
10
votes
2answers
296 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 ...
12
votes
0answers
213 views

CodeGolf Statistics - First 10 FrontPage sides [closed]

I was bored so I wrote a program in Mathematica to download all posts from the first 10 front pages (155 posts) and parse all entries to gather data from the languages and to make a top-list for code ...
0
votes
0answers
131 views

How to score a golflang with a 9-bit character set [duplicate]

So I’ve been thinking about creating a golflang somewhat inspired by Jelly, but I’ve decided for it to be encoded in a 9-bit codepage, so that there are 512 possible characters to use. I can come up ...
52
votes
0answers
2k views

How to count bytes FAQ

We've got a lot of questions asking how to count the bytes in different situations. This question is here to put them all in one spot. General questions How to count "interactive" answers ...
4
votes
3answers
217 views

How should we handle Excel answers with drag-down formulas? [duplicate]

This is a very grey area, because while excel is fun to enter, and play around with, often times it's seen as a pseudo-programming language. In Excel, one can drag-down formulas to automatically match ...
128
votes
16answers
7k views

How can we help users who are put off by the use of golfing languages?

Every other month someone expresses their (negative) feelings about golfing languages. Here is how this usually goes: they complain that they don't enjoy golfing in the languages they know because ...
14
votes
1answer
422 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'...
3
votes
2answers
183 views

Is "assembled" golflang code acceptable? [duplicate]

Recently, I have been thinking about creating golflang assemblers. Like assemblers, they just substitute a mnemonic(or a word) with the actual symbol. Since many golflangs aren't much more ...
13
votes
2answers
550 views

Byte count for imports (or other things) not needed for definition, but for execution

When we define a function that needs an import, we have to add it to the byte count. So far, so good. What about cases where the definition itself doesn't need the ...
4
votes
2answers
477 views

Auto-Golfing: Good or Bad?

For some kolmo questions, I use the golfing algorithms created for the challenge Golfing Strings in Fourier. Is this okay to do? Does this constitute as cheating? Some examples: Print This Question ...
2
votes
2answers
146 views

Do I need to use imports or can I call a class explicity?

New to code golf and tried finding an answer to this question but couldn't (surprisingly) When scoring my golfed Java code I was told that I need to add in my imports as part of my score. My question ...
1
vote
0answers
123 views

Is the interpreter part of the language or a separate language?

As I understand it, for our purposes a language is more or less defined by its implementation. That's one of the reasons why a program like Vim can also be "language". You just count keystrokes ...
11
votes
2answers
634 views

Longest Code Golf Answer Ever

An interesting number I failed to find - what's the longest code-golf accepted answer ever? Probably someone with SE scripting skills can figure this out. More accurate phrasing of my question - I'm ...
9
votes
2answers
340 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 ...
-5
votes
2answers
256 views

Is Brainfuck considered a serious contender

Brainf*** is far from a terse language. A (partially) golfed solution may be 1000's of bytes long. Similar to JSF***, these submissions are often autogenerated and will require significant work to ...
9
votes
1answer
381 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 (...
2
votes
0answers
162 views

Sub-byte character encodings [duplicate]

What do people think about defining the encoding of a character in a given language as taking place in less than a byte? For example, take Brainfuck. Brainfuck has exactly 8 possibilities per ...
37
votes
22answers
2k views

Advocate languages to golf in

I'm sure many of you want to attract golfers to compete in your favorite language. Given that it takes time to learn a language for golfing, why choose it over others? What aspects of the language ...
7
votes
0answers
251 views

Does code need to be 100% syntactically correct? [duplicate]

I've come across the following answer in a code-golf challenge in Haskell, where one has to provide a function: <bindings> <expression> Now, the last ...
24
votes
1answer
779 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 <...
4
votes
1answer
144 views

Should a JavaScript image-processing submission support CORS?

A clarification I'd like to have is whether JavaScript submissions for image-processing should support Cross-Origin Resource Sharing. Specifically, it requires setting the ...
5
votes
2answers
129 views

How do we respond to ungolfed submissions to code golf challenges? [duplicate]

I'm a regular lurker of PP&CG. Today I encountered a situation I'm not sure how this community regularly responds to. I'm asking this to learn more about the common and accepted practices here, ...
13
votes
2answers
1k views

Unnamed Functions in Code Golf

For many code golf questions, we allow functions as answers. What exactly does it mean for some code to be a valid submission as a function? This question came up during a discussion on built-ins, ...
13
votes
2answers
1k views

How should vim answers be scored?

I like vim a lot. I've been golfing with it a lot recently. We already have clearly established that vim is a programming language, but there aren't any clear rules on how to score vim answers. The ...
7
votes
2answers
288 views

On-topic to ask for help with an pre-existing code golf challenge from another site?

There is a code golf challenge on a foreign (not related to Stack Exchange) site with which I have a problem. The challenge is designed for Python 3 and has a length limit of 150 characters. I ...
4
votes
1answer
275 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 ...
15
votes
4answers
464 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 ...
42
votes
2answers
2k views

Golfing Class of a language

I feel like we may have enough data on this site to meaningfully break programming languages into classes. What I mean by classes is akin to Go's ranking system: If a player can win 90% of even games ...
14
votes
3answers
437 views

Should language-specific code golf challenges be explicitly disallowed?

In light of a recent code golf challenge in which the specification restricts participation to JavaScript, I think it's time we revisited making a hard rule about language-specific golfs. We may ...
9
votes
1answer
374 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 ...
0
votes
0answers
156 views

Is it cheating to invent a language for code golf? [duplicate]

With people using such cryptic languages as Jelly, where is the line? can I write my own compiler that solves the problem in a more wordy language when I type the number '0'? I can see that this is ...
0
votes
0answers
48 views

Should [code-golf] challenges with bonuses be tagged [code-challenge] instead? [duplicate]

We've had a discussion on whether or not code-golf challenges with bonuses should be allowed. This is a related, but different topic. Currently, challenges that have non-standard objective scoring ...
0
votes
0answers
58 views

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 ...
7
votes
1answer
144 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 ...
4
votes
3answers
216 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 ...
12
votes
2answers
220 views

Do I have to verify all answers?

I have an idea about a code-golf challenge. Will I need to verify/test every answer submitted ? Will I need to run code submitted to be sure that the answer meets the requirements ?
0
votes
1answer
84 views

How to score adding a Perl library on the command line? [duplicate]

I know the Perl -p flag is counted as one byte. I've just added the Perl bignum library to my answer to make it shorter. I'm using it like this: ...
10
votes
1answer
542 views

On scoring imported functions

There are lots of questions about whether to count the bytes in an import statement, etc. This question is not about that. Instead, this question is more inline with this question but I think it would ...
5
votes
3answers
170 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 ...
-1
votes
5answers
387 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. ...
11
votes
5answers
223 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 ...
14
votes
1answer
718 views

What are our rules about additional code accompanying function submissions?

This is an extension of this meta question. I've always assumed that function submissions were allowed under the premise that the code would be evaluated once and would in the process either: Define ...
3
votes
1answer
148 views

Methods / Tools for counting Minecraft program size

Extension of this thread. In this thread, please post tools or methods to count the size of programs to aid others in this process. These tools/methods should follow the counting rules listed in the ...
25
votes
2answers
2k views

Programming in LabVIEW - how to measure program size?

Inspired by this question, how would a LabVIEW program be scored? As one of the only graphical languages in common use today, LabVIEW is a bit of an outsider. As odd as it is, LabVIEW is a serious ...
8
votes
4answers
607 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 ...