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
100 votes
92 answers
17k views

It was just a bug

Inspired by the bugged output in @Carcigenicate's Clojure answer for the Print this diamond challenge. Print this exact text: ...
Kevin Cruijssen's user avatar
65 votes
125 answers
17k views

Duck, duck, goose!

Remember the kids game, 'Duck, Duck, Goose'? No? Me neither. The challenge Print the word 'duck' on individual lines an indeterminate amount of times. Print the word 'goose'. Your program ends. The ...
AJFaraday's user avatar
  • 11.8k
75 votes
91 answers
17k views

Build me a brick wall!

Challenge I need help building a brick wall! Throw together some code for me using no input and produce the following output wall shown below: ...
Dylan's user avatar
  • 935
69 votes
85 answers
11k views

Make the Mexican Wave

In as few bytes as possible, write a program or function that outputs the following: ...
absinthe's user avatar
  • 8,629
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
75 votes
59 answers
20k views

Tips for code-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 ...
jcolebrand's user avatar
  • 1,863
79 votes
53 answers
35k views

Tips for golfing in Ruby

What general tips can you give for golfing in Ruby? I'm looking for ideas that can be applied to code golf problems in general that are specific to Ruby. (For example, "Remove comments" would not be ...
grokus's user avatar
  • 1,267
54 votes
84 answers
8k views

Output Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo

Challenge The goal is to output Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Context. (Maybe another interesting challenge could be printing all ...
Orangutan's user avatar
  • 737
52 votes
96 answers
9k views

Alphabet triangle

You are to print this exact text: ...
Leaky Nun's user avatar
  • 49.7k
57 votes
77 answers
8k views

Test a number for narcissism

A Narcissistic Number is a number which is the sum of its own digits, each raised to the power of the number of digits. For example, take \$153\$ (3 digits): \$1^3 + 5^3 + 3^3 = 153\$ \$1634\$: \$1^...
Iszi's user avatar
  • 2,536
80 votes
46 answers
24k views

Shortest Game of Life

Conway's Game of Life is the classic example of cellular automation. The cells form a square grid and each has two states: alive or dead. On each turn, each cell simultaneously updates according to ...
Griffin's user avatar
  • 4,755
36 votes
73 answers
9k views

Randomizing until 0

Challenge Sandbox post Given a positive integer (K) Output a uniformly-random integer (Y) between ...
Luis felipe De jesus Munoz's user avatar
36 votes
66 answers
5k views

Insist on an answer

At runtime, keep prompting for a line of input until the user inputs something (other than an empty newline), i.e. does not just press Enter or OK. Output or result is neither required nor prohibited. ...
Adám's user avatar
  • 30k

15 30 50 per page
1
2 3 4 5
8