Linked Questions

328 votes
178 answers
141k views

Tips for golfing in Python

What general tips do you have for golfing in Python? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to Python (e.g. "remove comments" is ...
moinudin's user avatar
  • 12.6k
173 votes
97 answers
68k views

Tips for golfing in JavaScript

What general tips do you have for golfing in JavaScript? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to JavaScript (e.g. "remove ...
mellamokb's user avatar
  • 6,073
106 votes
39 answers
27k views

Tips for golfing in Java

Are there any useful shortcuts that can be used in Java? As shown below, import already adds at least 17 characters to a program. ...
user avatar
37 votes
108 answers
6k views

Alphabet Staircase

The Challenge Your task is to create a program or function that outputs the following with no input: ...
SpookyGengar's user avatar
  • 1,813
70 votes
43 answers
12k views

Tips for golfing in Bash

What general tips do you have for golfing in Bash? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Bash (e.g. "remove comments" is not ...
manatwork's user avatar
  • 20.1k
40 votes
73 answers
4k views

Semi-Diagonal Alphabet

Given a letter of the English alphabet, your task is to build a semi-diagonal alphabet to the input. How to build a Semi-Diagonal alphabet? Brief Description: First, you take the position of the ...
user avatar
60 votes
49 answers
4k views

Fit a word into an alphabet grid

Inspired by a meme I saw earlier today. Challenge description Consider an infinite alphabet grid: ...
shooqie's user avatar
  • 5,642
26 votes
51 answers
2k views

Draw an alphabet party hat

Your task is to print this exact text: ...
Oliver Ni's user avatar
  • 10.6k
48 votes
14 answers
16k views

Tips for golfing in 05AB1E

Do you have any tips for code-golfing in 05AB1E, a golfing language created by Adnan? Your tips should be at least somewhat specific to 05AB1E. Please post one tip per answer.
Oliver Ni's user avatar
  • 10.6k
11 votes
6 answers
527 views

Tips for golfing in Forth

What general tips do you have for golfing in Forth (and its clones)? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to Forth (e.g. "...
cat's user avatar
  • 5,849