Linked Questions
12 questions linked to/from Print 0 to 100 without 1-9 characters
326
votes
177
answers
138k
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 ...
120
votes
405
answers
30k
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 ...
173
votes
97
answers
67k
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 ...
162
votes
61
answers
38k
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 ...
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.
...
358
votes
7
answers
50k
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:
<...
70
votes
43
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 ...
70
votes
23
answers
7k
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 ...
12
votes
71
answers
3k
views
Summing the Digits of a Number
Challenge
Given a non-negative integer, find the sum of its digits.
Rules
Your program must take a non-negative integer as input.
Your program should output the sum of the digits of the input ...
49
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
1k
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 ...