Linked Questions
12 questions linked to/from Print 0 to 100 without 1-9 characters
342
votes
184
answers
156k
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 ...
125
votes
421
answers
35k
views
Print a 10 by 10 grid of asterisks
Background
This is a standard textbook example to demonstrate for loops.
This is one of the first programs I learnt when I started learning programming ~10 years ago.
Task
You are to print this exact ...
178
votes
99
answers
74k
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 ...
169
votes
65
answers
44k
views
Tips for golfing in C
What general tips do you have for golfing in C? I'm looking for ideas that can be applied to code golf problems in general that are at least somewhat specific to C (e.g. "remove comments" is not an ...
107
votes
39
answers
29k
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.
...
369
votes
9
answers
54k
views
Upgoat or Downgoat?
Given an image of a goat, your program should best try to identify whether the goat is upside down, or not.
Examples
These are examples of what the input may be. Not actual inputs
Input:
Output:
<...
71
votes
43
answers
14k
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 ...
74
votes
25
answers
8k
views
Tips for golfing in R
I'm looking for tips for golfing in the R statistical language. R is perhaps an unconventional choice for Golf. However, it does certain things very compactly (sequences, randomness, vectors, and ...
16
votes
83
answers
5k
views
Summing the Digits of a Number
Challenge
Given a non-negative integer, find the sum of its decimal digits.
Rules
Your program must take a non‐negative integer as input.
Your program should output the sum of the digits of the ...
50
votes
19
answers
3k
views
Tips for golfing in The Shakespeare Programming Language
What general tips do you have for golfing in The Shakespeare Programming Language? I'm looking for ideas which can be applied to code-golf problems and which are also at least somewhat specific to SPL ...
20
votes
12
answers
2k
views
Bandwidth of a matrix
A band matrix is a matrix whose non-zero entries fall within a diagonal band, consisting of the main diagonal and zero or more diagonals on either side of it. (The main diagonal of a matrix consists ...
15
votes
17
answers
2k
views
Print the last answerer's first submission
In this challenge, your past self comes back to help or hurt someone else!
The task is simple: write a full program, not a function, that prints the first code submission on this site submitted by the ...