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
13
votes
2answers
397 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 ...
2
votes
5answers
275 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 ...
6
votes
1answer
406 views

Machine code Input/Output defaults

We already have a question about default I/O for general code-golf submissions. However, entries in machine code have different built-in I/O capabilities from entries in high-level languages. Should ...
33
votes
8answers
5k views

Programming in Minecraft (Redstone) - how to measure program size?

Since programs may be created in vanilla (un-modded) Minecraft using redstone to create logic gates (and more), someone could create such a program for a challenge on this site. How would such an ...
15
votes
1answer
402 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 ...
8
votes
1answer
207 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?
4
votes
3answers
357 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. ...
15
votes
4answers
706 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.
13
votes
3answers
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 ...
21
votes
3answers
900 views

Does PPCG fulfil a role as a catalogue for golfed solution of standard programming exercises?

Rosetta Code collects solutions to standard programming exercises in hundreds of programming languages. However, it focuses on "good" or idiomatic solutions in those languages. I'm not aware of a ...
12
votes
1answer
321 views

Am I allowed to use my own invented languages to solve a code golf?

On the conditions that the language is general use (i.e., doesn't perform the task in 1 character) and follows the rule of having been invented before the question was asked. I've written languages ...
5
votes
2answers
210 views

On golfing suggestions

These questions involve the practice of commenting on another user's code-golf answers to suggest a shortening of the code. Which of these are polite? Which are best practices? Commenting on an ...
15
votes
2answers
531 views

Are compiler-specific submissions allowed?

For example, in a c++ submission, this is valid if you use g++ #include <iostream> main() { std::cout << "Hello world!"; } but in any other ...
18
votes
4answers
700 views

Code Golf Tutorials?

There are a lot of intelligent people on PPCG, and for that reason a lot of our usual challenges are hard. This means that we are throwing new users straight into the deep end with huge problems which ...
7
votes
1answer
230 views

Golfing Inform 7

Inform 7 is a language for creating interactive fiction whose syntax approximates natural language. It is so verbose that it will almost never be a good choice for golfing, but its verbosity is its ...
1
vote
1answer
107 views

Would a class-writing code golf challenge be appropriate?

There are a lot of challenges that get you to write programs and/or functions, but (almost) none that get you to write classes. I thought of a way to lay out class-writing challenges - it's quite ...
14
votes
2answers
279 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. ...
7
votes
1answer
379 views

How fast are golfing languages?

I have a preconception that golfing languages are not fast running. I have no idea if this is correct for some/all golfing languages. The reason I wonder is that if they are slower than other ...
32
votes
6answers
3k views

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 ...
5
votes
3answers
350 views

Turing Machine challenge

I want to post a challenge using only Turing Machines. I want the winning solution to be a combination of smallest machine (fewest states) and shortest worst case runtime (up to two machines). I am ...
25
votes
3answers
2k views

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 ...
13
votes
3answers
1k views

Counting bytes for multi-file programs

So far, submissions consisting of multiple files have simply been counted by summing up the scores of the individual files. Also file names aren't counted as long as they are arbitrary. (We do count ...
0
votes
0answers
109 views

Are C# LinqPad answers encouraged? [duplicate]

The question Find i^n, given n does not clearly state whether the solution must be a compilable program or can be an expression, neither does it identify where the input shall come from. This leads ...
7
votes
2answers
239 views

Code challenge - do your best with limited code size. How much to allow?

I would like to make a code challenge (or a new type of challenge), which is based on code size, but in a "dual" way to code-golf: code size is limited, and the winner is whoever makes the best code (...
4
votes
1answer
349 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 ...
16
votes
2answers
1k views

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 ...
0
votes
1answer
87 views

Sort by code size for code-golf problems [duplicate]

For easier position calculation and as a handy way for the questioner, a sort by code size feature should be added which would sort out all the answers from the very least byte-ed to the most byte-ed.
5
votes
6answers
296 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-...
3
votes
1answer
232 views

Count the spaces in Fortran Programs?

In Fortran 77 (and probably older ones), you require six spaces before each line. This makes it incredibly difficult to golf, so should we count those spaces in the byte/character count?
111
votes
99answers
32k views

Default for Code Golf: Input/Output methods

It looks like we have a consensus that we want certain defaults for the format which answers are expected in for code-golf. On that poll, the question arose twice, which input/output formats should be ...
4
votes
1answer
264 views

Should point-free function expressions be allowed when a function is asked for?

Should an expression evaluating to a function count as a function for the purpose of providing a solution when a function is asked for? An earlier question on meta seems to indicate a consensus that ...
47
votes
6answers
7k views

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 ...
5
votes
1answer
247 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 ...
72
votes
9answers
15k views

Interpretation of Truthy/Falsey

Quite a few code-golf questions require output to be "truthy or falsey". This is possibly confusing as these terms can possibly mean different things to different people, and especially in different ...
0
votes
2answers
480 views

Programming Praxis weekly challenges

This site (http://programmingpraxis.com) publishes every week very interesting code challenges, that could totally fit here. Example: http://programmingpraxis.com/2014/07/25/number-words/ : that ...
8
votes
2answers
298 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 ...
-9
votes
2answers
180 views

Agreed formula for Scoring code-golf

Code-Golf scoring without need to print all in one line Often great answers in code-golf questions are too hard to read. Also the counting of bytes or characters should just count all characters not ...
2
votes
0answers
383 views

Atomic Golf COBOL (IBM Enterprise COBOL)

Just to make it clear, Atomic Golf COBOL will not be a competitive golfing language. The longer the shortest answer (80+, the longer the better) the more possible to get close, however, COBOL is very ...
2
votes
1answer
463 views

Score Brainfuck as 0.5 bytes per char (because it only uses 8 characters)? [duplicate]

I think that Brainfuck and many other esoteric languages almost never win code-golf, because they take many characters to express things. So, overall, Brainfuck programs are longer in bytes, because ...
18
votes
5answers
3k views

How to score TI-BASIC

How do we score code written in TI-BASIC, when it comes to multi-character words? For example: :If X>2:Then:Stop Seemingly, the above should count as 17 ...
15
votes
4answers
1k views

Should function literals be allowed when a function is asked for?

I'm arguing with the poster of this answer. The function literal as is doesn't cause the function to be defined, it has to be assigned to a variable, giving it a name or wrapping it like ...
-5
votes
1answer
149 views

Creating a language conversion table [duplicate]

Edit: This is not the same as Language Handicap. Language Handicap advocated for a fixed number of characters to be subtracted, which really only applies to a subset of languages, such as C++. I am ...
8
votes
2answers
347 views

URL shortener policy [duplicate]

I haven't seen a discussion on this yet, but I also haven't really seen it used in answers, so I figured it was worth asking a question for link-reference in the future. So, what's the policy on ...
-1
votes
1answer
71 views

Shouldn't the users on codegolf be able to close their questions?

Shouldn't the users on codegolf be able to close their question after let's say the question's winners are announced without them having to have some amount of reputation?
17
votes
4answers
613 views

Should bonuses be allowed for [code-golf] questions?

Prompted by a discussion between Peter Taylor and myself, I'd like to solicit the community's opinion on the following issue: Should awarding score bonuses for extra features disqualify a challenge ...
6
votes
2answers
491 views

COBOL for Golf - how to count characters

Yes. COBOL. I assume that the full power of a compiler implementation may be used... but, COBOL has some historical disadvantages if used for code-golf, at least for compilers which do not support ...
1
vote
1answer
147 views

Where is the rule against new languages specified?

I'm pretty sure I've seen a rule against new languages, especially for code golf, somewhere on this site - probably in the Help Center. However, I'm having a hard time finding it. Does this rule ...
3
votes
3answers
386 views

Creating new language. Would it be legal?

Today with friend of mine discussed about code golf, I want to ask your opinion about the thing we discussed about. Would it be legal if I create my own programming (actually scripting) language with ...
8
votes
1answer
250 views

Strike-through previous character counts

I often notice posts which contain strike-through versions of previous character counts, like this: Perl (123 111 chars) I don't see this practice mentioned anywhere in the FAQs, nor here on meta. ...
26
votes
3answers
608 views

Where does Programming Puzzles & Code Golf fit in the SE mission?

Don't get me wrong, I love this website. I think it's fun and all but I can't help thinking... How does it correspond to Stack Exchange's mission : What is Stack Exchange? Stack Exchange is a ...