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
1 vote
1 answer
142 views

It seems the consensus on Scratch is to use scratchblocks2 syntax, but what about "when green flag clicked"?

In many code-golf Scratch submissions, I see when green flag clicked used, when when gf clicked is also valid in scratchblocks2. ...
Silas Reel's user avatar
1 vote
1 answer
93 views

Are fixed input allowed if the bytes count? [closed]

E.g. requiring to call by f(4), and add 1 to the byte count Or maybe when inputting a choice, require input f`!#%` or ...
l4m2's user avatar
  • 24.5k
1 vote
1 answer
102 views

Bulk editing code-golf answers to add headers [duplicate]

Is it considered bad to edit old code-golf answers to add in headers so that the answers can be easily seen by tools using the SEDE or data dumps? I can see pros and cons to doing this, and I what is ...
jrtapsell's user avatar
  • 1,003
1 vote
2 answers
162 views

Making minimal modifications to fix code

This is bugging the hell out of me. I could have sworn I had seen the challenge here: http://golf.shinh.org/all.rb a while back, but I've just gone through all 500 of those challenges and none of them ...
mowwwalker's user avatar
1 vote
0 answers
85 views

Are there specific types of code golf challenges on this site?

I posted a question in hope of starting a shortest code challenge, but it seems to attract lots of downvotes and the only answer tried to help as a programming problem. One comment on the question ...
paki eng's user avatar
  • 175
1 vote
0 answers
69 views

What loopholes should be assumed when a name-specific file is used for code golf?

I have posted this golfing tip for Bash before: In Pure Bash (or any other pure shellscript), use . for looping. It's a tip that recomments using a file whose the ...
user avatar
1 vote
0 answers
68 views

Can we assume computer be fast enough?

Consider such a question Take a program P and an integer n, check whether P halts. You may ...
l4m2's user avatar
  • 24.5k
1 vote
0 answers
37 views

Can we pass properties of the input as parameters? [duplicate]

Some challenges require, for instance, lists as input. A list has a property being its size. Several languages have builtins to get properties such as the size for a list (all golfing language, ...
Olivier Grégoire's user avatar
1 vote
0 answers
71 views

Is a slightly changed compiler allowed? [duplicate]

Some maybe not-intended-to-program languages may have some extra limitations. Is it allowed to change it to solve a problem? If so, how the length go? p.s. marking this topic as duplicate of this ...
l4m2's user avatar
  • 24.5k
1 vote
0 answers
60 views

Function not that directly used allowed? [duplicate]

In this answer, the function is defined as With(Math)f=(a,b,c,d)=>... (1) However, f is not used in the function, so it ...
l4m2's user avatar
  • 24.5k
1 vote
0 answers
57 views

Are kernel-mode functions and kernel modules valid code-golf answers?

In general, user-mode processes have a much richer API environment available (through stdlib, and other libraries you can possibly import), than does (Linux) kernel-mode code. However there are some ...
Digital Trauma's user avatar
1 vote
0 answers
136 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 ...
Ashtâr B.'s user avatar
1 vote
3 answers
66 views

Can Function Objects be Appened to STDIN From the Stack?

This is mostly specific to Vyxal, but I've worded the language so that any hypothetical stack language could utilise this Say you have a stack-based language which supports function objects on the ...
lyxal's user avatar
  • 33.6k
0 votes
1 answer
94 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.
Mohammad Areeb Siddiqui's user avatar
0 votes
1 answer
92 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: ...
CJ Dennis's user avatar
  • 4,266
0 votes
1 answer
170 views

Is the Chrome UserScript still recommended?

If I recall correctly, the chrome user script used to be recommended in the About/FAQ pages somewhere, but I can't find it anymore. I know that UserScripts must be installed from the Chrome Web Store ...
MrZander's user avatar
  • 942
0 votes
2 answers
195 views

What to do if there're two answers with the shortest code?

On my Code Golf "Converting a string to lower-case (without built-in to-lower functions!)", there're two answers with the same character count (10 characters), and they're both the answer with the ...
ProgramFOX's user avatar
  • 8,333
0 votes
1 answer
255 views

what is difference between code golfer and code fu? [closed]

I am working around to stick with this site bit i am not able to understand what question should ask here and what exactly code golfers and code fu means and main difference I know this very silly and ...
twister_void's user avatar
0 votes
1 answer
83 views

Do golfing languages support rational number arithmetic?

I proposed this code golf on sandbox: Integer Logarithm Take \$a \in ℤ_{>1}\$ and \$b \in ℤ_+\$ as inputs. Write a function \$f\$ that: $$ f(a,b) = \left\{ \begin{array}{ll} ...
Dannyu NDos's user avatar
  • 5,961
0 votes
0 answers
98 views

Are Rubik's Cube fewest move type challenges allowed? [duplicate]

We have atomic-code-golf which lets us have challenges involving things other than byte count. So I wonder if Rubik's Cube fewest move challenge (FMC) type challenges are allowed. I see no objections ...
qwr's user avatar
  • 12.1k
0 votes
0 answers
28 views

Are modifications to existing languages allowed as submissions? [duplicate]

Say I have a language I'd love to use (like JavaScript for example), but there are tons of little pieces of functionality I'd love to modify built-ins with, like ...
Patrick Roberts's user avatar
0 votes
0 answers
49 views

What should be done when there are joint winners? [duplicate]

On the question How long is my number: Restricted Version, there are multiple answers which are 1 byte long? How should judge which answer to give the green check to?
Beta Decay's user avatar
  • 23.4k
0 votes
0 answers
69 views

Can lambda parameter types be left off if potentially inferable from context? [duplicate]

This Java answer (and this one) uses a lambda that does not explicitly declare its parameter type, but this Scala answer includes a parameter type. in both cases, the type could be inferred when it is ...
Brian McCutchon's user avatar
0 votes
0 answers
80 views

A meta PCG question (challenge?) [duplicate]

Are there PCG challenges where "general purpose" or "commonly used" [*] programming languages do better than the special PCG targetted languages? Is this in itself an interesting meta challenge? I ...
GreenAsJade's user avatar
0 votes
0 answers
159 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 ...
user avatar
0 votes
0 answers
50 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 ...
user avatar
0 votes
0 answers
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 ...
DJMcMayhem's user avatar
  • 59.3k
0 votes
0 answers
115 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 ...
Thomas Weller's user avatar
-1 votes
1 answer
84 views

Is it allowed to take input by repeatedly call a function?

In C, to sum up some numbers, can do: *X;f(x,n){X=x;x=0;while(n--)x+=*X++;} // not sure if return the answer, assuming it does input a pointer ...
l4m2's user avatar
  • 24.5k
-1 votes
1 answer
76 views

Requiring an objectly array in JavaScript

Consider an example challenge: Given a number b and an array a, output the bth element of ...
l4m2's user avatar
  • 24.5k
-1 votes
1 answer
140 views

Maximum code-golf length

If we have a code-golf question that we have a golfed answer to in, say, Python, how long does that program have to be for it to not be a good idea to ask that question/for that to be code-golf (if ...
Dadsdy's user avatar
  • 2,085
-1 votes
1 answer
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?
ioanD's user avatar
  • 163
-1 votes
2 answers
37 views

What tag for questions that require code golfing to be valid?

Some questions require some amount of golfing because they have a maximum byte limit or are answer chaining and require no more than x bytes added to the previous answer. However, code golf is not ...
user avatar
-2 votes
1 answer
143 views

User disobeying rules?

So last question that I posted. i.e : this, I wanted to ask because a specific new user whom I have warned almost on all answer he has posted (5-6) was not following, yet he keeps answering with ...
Muhammad Salman's user avatar
-2 votes
2 answers
165 views

Ethics of Golfing in Assembly or other extremely uncommon languages

My understanding of code-golf in general is that you're to provide the shortest solution in a given language. However, for most challenges, you could safely pick a language no one really is familiar ...
Andrew Baumher's user avatar
-2 votes
1 answer
137 views

New code-golf metric : Efficiency*characters

So, I thought about a new metric of code-golf, the code with the smallest value wins. The value is calculated by characters*time to run. So if you use an programming language like python, it's very ...
Luatic's user avatar
  • 635
-3 votes
1 answer
99 views

What's your favorite code golf video? [closed]

Do you have a favorite code-golf video? Maybe someone golfing before it was cool? Or because it was a way to solve a problem?
Filip Haglund's user avatar
-4 votes
1 answer
150 views

Need help with code golf [duplicate]

What in the world is code golf and how is it important to me? I have already looked in the tour.
idiot's user avatar
  • 1
-5 votes
2 answers
271 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 ...
Rohan Jhunjhunwala's user avatar
-5 votes
1 answer
82 views

New challange variant "Scored Code Golf" [closed]

I have a new idea for code-golf challenges, scored code golf would be used for multi part challenges that correspond and the score adds up. This would allow for linking different challenge types ...
user avatar
-5 votes
1 answer
157 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 ...
isaacg's user avatar
  • 42k
-6 votes
2 answers
211 views

Why do I feel like Code Golf is ruining the point of Python?

The Zen of Python ...
OmegaO333's user avatar
-8 votes
1 answer
145 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: ...
anna328p's user avatar
  • 6,396
-8 votes
2 answers
118 views

Popularity-code-golf?

This question is very simple : Should we introduce a code-golf where only popular/unpopular programming languages are allowed ? And if yes, how can we measure popularity ? Probably with the Top of ...
Luatic's user avatar
  • 635
-9 votes
2 answers
200 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 ...
bacchusbeale's user avatar
  • 1,263

1 2 3 4
5