Linked Questions

323 votes
176 answers
133k 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.4k
172 votes
95 answers
65k 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,063
106 votes
39 answers
26k 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. ...
Rob's user avatar
  • 1,477
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,783
70 votes
42 answers
11k 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
  • 19.8k
40 votes
72 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,562
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.5k
47 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.5k
11 votes
6 answers
457 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,789