Skip to main content

Questions tagged [tips]

For questions asking for tips on golfing in a specific language, doing well in certain challenge tag, or improving a particular piece of code.

Filter by
Sorted by
Tagged with
1 vote
1 answer
156 views

I would like to create a language that is specifically designed for compiling/translating to another Turing tarpit language. I want to make the program of the target language to be as short as ...
Fmbalbuena's user avatar
  • 5,105
2 votes
1 answer
351 views

I'm pretty new to code golfing, but I recently came across a guy on Kattis that consistently has exactly 5 character Bash solutions for some problems. For example, here is a leaderboard showing his 5 ...
Donald Trump's user avatar
8 votes
5 answers
2k views

What general tips do you have for golfing in ☾ (Moon)? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to ☾ (e.g. "remove ...
noodle person's user avatar
7 votes
4 answers
1k views

We already have a few language-specific tips threads for languages which fall under the array-language umbrella, but there are many golfing tricks which are more or less universal among these ...
noodle person's user avatar
7 votes
1 answer
356 views

Maple is designed for mathematical computation, with a focus on symbolic algebra, calculus, and data visualization. I’m experimenting with code golf in Maple and want to make my scripts as concise as ...
user avatar
4 votes
0 answers
180 views

Sidef, created by Daniel Șuteu, is designed for expressive, compact code, especially in mathematical domains (e.g., number theory, combinatorics). I’m diving into code golf challenges using Sidef and ...
user avatar
11 votes
7 answers
3k views

Fortran is a compiled imperative language known for its numerical and scientific computing strengths. It blends traditional procedural programming with some modern features like array operations. What ...
user avatar
3 votes
1 answer
132 views

COBOL is a high-level, compiled programming language designed for business applications, readability, and long-term maintainability. It emphasizes verbose syntax, English-like readability, and robust ...
138 Aspen's user avatar
  • 7,257
3 votes
5 answers
205 views

What are some general tips you have for golfing in Bespoke? I want answers that are specific to Bespoke (e.g. don't just say "remove comments"). One tip per answer. Esolangs page ...
Josiah Winslow's user avatar
3 votes
0 answers
203 views

Zig is a low-level, statically typed, and compiled systems programming language designed for safety, performance, and simplicity. It provides direct control over hardware with an emphasis on explicit ...
138 Aspen's user avatar
  • 7,257
0 votes
1 answer
330 views

I have the following Python code, which is 214 bytes long: ...
RannStudio's user avatar
10 votes
4 answers
908 views

There isn't a builtin in golfscript which lets you rotate a bigger portion of the stack than the three top-most elements. It should take one number n as argument and rotate the nth value from the top, ...
Styleurcam's user avatar
0 votes
1 answer
402 views

The following code is 47 characters. print(("Ekki v","V")["COV"in input()]+"eikur!") How can it be reduced to 46 or less? I ...
LargeHorse's user avatar
3 votes
0 answers
193 views

What general tips do you have for golfing in Emmental? It is a self-modifying language defined by a meta-circular interpreter, so I wonder if there are tips for golfing for this esoteric programming ...
CrSb0001's user avatar
  • 867
8 votes
5 answers
447 views

What general tips do you have for golfing in Acc!!? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Acc!! (e.g. "remove comments&...
Mukundan314's user avatar
  • 13.7k
7 votes
2 answers
596 views

Recursion is actually quite powerful, sometimes its doesn't look like that child problem of itself exist, but recursion is just helpful. One case per answer.
l4m2's user avatar
  • 32.7k
1 vote
0 answers
274 views

I'm currently converting a Float32Array to an Int32Array for input to a real-time audio raw PCM to MP3 recording application. <...
guest271314's user avatar
4 votes
0 answers
125 views

This will be a bit of a different challenge. Back in 2023, I developed a 2D esolang called Electra, and looking back at my hello world program, (which is 582 bytes by the way) I see a lot of room for ...
DolphyWind's user avatar
-2 votes
1 answer
284 views

I am exploring a unique approach to the classic problem of Reverse Polish Notation on code.golf. Unlike the conventional solutions, my focus lies on leveraging the ...
Golfscript-Noob's user avatar
15 votes
9 answers
2k views

What general tips do you have for golfing in Uiua? I'm looking for ideas that can be applied to code golf problems in general that are specific to Uiua. (e.g. "remove comments" would not be ...
Joao-3's user avatar
  • 2,090
8 votes
4 answers
2k views

I recently tried to produce the shortest C code possible to display all its command line arguments (which are stored in argv). I ended with a relatively small piece of code, and I was wondering if ...
Chi_Iroh's user avatar
  • 193
11 votes
1 answer
458 views

The reason for this question is because I made a deadlineless bounty and I need a tips question to link in the bounty Vyxal 3 is the third major version of the Vyxal golfing language. As it is ...
lyxal's user avatar
  • 35.6k
6 votes
2 answers
393 views

What is the shortest selector (by character count) to select ALL html elements on a web page, without using asterisk (*)? Some examples are the following: ...
user3163495's user avatar
12 votes
7 answers
4k views

I wrote a code that separates the numbers from 1 to 9999 by comma void p(n){printf("%d,",n);if(n<9999){p(n+1);}}main(){p(1);} Is there a way to make ...
olivia's user avatar
  • 129
2 votes
2 answers
281 views

Not sure if it's correct to ask such a question on this site, but let's try. Let a(n) be a sequence of positive integer such that a(1) = 1. To reproduce the sequence a(n) through itself, use the ...
user avatar
6 votes
2 answers
383 views

The aim of this post is to gather all the tips that can often be applied to radiation-hardening challenges. Please only post answers which can apply to a large number of languages, and one tip per ...
Command Master's user avatar
-2 votes
1 answer
148 views

Some built-in functions in PHP return mixed types, like file_get_contents that returns both string or ...
Olle Härstedt's user avatar
1 vote
1 answer
252 views

I have the following Haskell code to generate the the values of the Fibonacci sequence which are even as an infinite list: ...
Wheat Wizard's user avatar
  • 103k
2 votes
0 answers
133 views

Anyone got tips for golfing in Thue. One tip per answer, and no tips aplicable to all languages (like remove comments)
Dadsdy's user avatar
  • 2,105
4 votes
4 answers
265 views

What tips do you have for golfing in (,)? I've found that there are so many ways to make code shorter, and I want more ways. I doubt there even are any tips for (,) that are applicable in the majority ...
Dadsdy's user avatar
  • 2,105
7 votes
6 answers
317 views

Arturo is a bytecode-compiled/interpreted, garbage-collected general-purpose language filling a role similar to JavaScript, Python and Ruby. It is centered around the concept of blocks, which hold ...
chunes's user avatar
  • 27.9k
13 votes
2 answers
1k views

Bitshift Variations in C Minor by Robert Miles is a Code Golf music piece written in C (with some additional bash commands). It was originally presented in a 2016 Computerphile video Code Golf & ...
brubsby's user avatar
  • 253
-3 votes
1 answer
595 views

So I got kinda bored and was wondering if it was possible to make this code shorter without modifying anything except a file named coin.py... ...
Eric's user avatar
  • 121
3 votes
6 answers
1k views

Thunno 2 is a stack-based golfing language with around 400 commands (achieved through overloads) created by me, The Thonnu. It seems like a good idea to share some tips for golfing in Thunno 2. Please,...
The Thonnu's user avatar
  • 18.7k
6 votes
2 answers
452 views

I have the code: ...
Dark Programmer's user avatar
7 votes
1 answer
917 views

I'm trying to solve a CSS challenge. It contains a rotated leaf shape (looks like an eye). Score for the challenge depends on amount of characters of the code. Here's my way to make a leaf shape: <...
j-0-n-e-z's user avatar
  • 171
16 votes
15 answers
2k views

SVG is an XML vector graphics markup language embeddable in web content. Your tips should be at least somewhat specific to SVG. Please post one tip per answer.
Jakob Lovern's user avatar
9 votes
5 answers
640 views

I'm trying to shorten a bash solution to a Code Golf challenge, which requires an output of true or false. I've managed to ...
ShadowRanger's user avatar
5 votes
3 answers
954 views

Consider: c=(a,b)=>(+a||0)+(+b||0) Yes, it is not good to solve it like that. But I want to shorten it even more. If a is a ...
Felix Schönherr's user avatar
0 votes
2 answers
301 views

Wren is a small, fast, class-based concurrent scripting language. Does anyone have any tips for this language? Please make sure to post 1 tip per answer, and don't post answers like "remove ...
DialFrost's user avatar
  • 5,189
14 votes
4 answers
2k views

Fastest code is a scoring method on this site where the goal is to write code that is as fast as possible. From the tag wiki: The winner of a fastest-code challenge is determined by the runtime ...
mousetail's user avatar
  • 14.4k
9 votes
2 answers
694 views

I want to read two strings on separate lines, each string the same length and containing only 0's and 1's, and determine if the first is the one's complement of the second. How succinctly can this be ...
Fixee's user avatar
  • 191
3 votes
0 answers
122 views

Does anyone have tips on how to golf in this language? Please one tip per answer and avoid posting simple and general tips such as "remove whitespace". Here is the github link and here is ...
DialFrost's user avatar
  • 5,189
2 votes
0 answers
325 views

I have made a short script that will pull dns txt records down from a server and combine them into a single string. DNS txt records are: 1.website.com ...
I am Jakoby's user avatar
5 votes
1 answer
266 views

If you consider the following PHP+C polyglot snippet, there is a problem regarding class property access in the printf call: ...
Olle Härstedt's user avatar
4 votes
3 answers
1k views

So the golf question was like this: You are given a number T and then a total of T number of 17-character strings. For each of ...
chnmasta05's user avatar
5 votes
1 answer
784 views

I could not think of a better title. This is a tips question. I'm asking for tips on golfing my code. I recently took part in a code golf competition in C. The competition ended and I lost. The ...
TwilightSparkle's user avatar
11 votes
7 answers
874 views

Knight is the Language of the Month for August 2022, and I noticed that it didn't have a tips page, so here it is! I'm looking for ideas which can be applied to code-golf problems and which are also ...
Aiden Chow's user avatar
  • 14.6k
15 votes
2 answers
2k views

So I have the situation where I have one boolean value a and, if that one is true and b<c ...
Julian Wagner's user avatar

1
2 3 4 5
8