Linked Questions

203 votes
436 answers
84k views

Introduction In our recent effort to collect catalogues of shortest solutions for standard programming exercises, here is PPCG's first ever vanilla FizzBuzz challenge. If you wish to see other ...
Beta Decay's user avatar
  • 23.6k
341 votes
184 answers
155k views

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
  • 13k
390 votes
156 answers
295k views

Write a program that seemingly adds the numbers 2 and 2 and outputs 5. This is an underhanded contest. Your program cannot output any errors. Watch out for memory holes! Input is optional. ...
qwr's user avatar
  • 12.4k
150 votes
349 answers
35k views

Write the shortest code you can that produces an infinite output. That's all. You code will only be disqualified if it stops producing output at some point. As always in code golf, the shortest code ...
tbodt's user avatar
  • 2,504
240 votes
115 answers
45k views

Your task is to build a program (using only printable ASCII characters and/or tabs and newlines) that prints out exactly the characters in the printable ASCII space (...
Joe Z.'s user avatar
  • 35.4k
395 votes
50 answers
60k views

In this challenge, you must take a string matching the regex ^[a-zA-Z]+$ or whatever is reasonable (you don't have to consider uppercase or lowercase letters if you ...
Destructible Lemon's user avatar
232 votes
67 answers
20k views

What happens when the CapsLock key on your keyboard doesn't have a notch in it? "This hPPENS." The goal of this program is to consistently emulate keyboard misses where each A press is replaced with ...
Broadwell's user avatar
  • 1,881
87 votes
149 answers
15k views

This is the Collatz Conjecture (OEIS A006577): Start with an integer n > 1. Repeat the following steps: If n is even, divide it by 2. If n is odd, multiply it by 3 and add 1. It is proven that for ...
Doorknob's user avatar
  • 72.1k
51 votes
104 answers
6k views

This challenge, while probably trivial in most "standard" languages, is addressed to those languages which are so esoteric, low-level, and/or difficult to use that are very rarely seen on this site. ...
Leo's user avatar
  • 12.9k
48 votes
105 answers
18k views

Here is a simple challenge for you: You must produce this ASCII representation of a chess board. White is represented by uppercase characters, and black is represented by lowercase. Empty tiles are ...
DJMcMayhem's user avatar
  • 60.1k
59 votes
84 answers
9k views

According to some controversial story, the odrer of ltteres in a wrod deos not mttaer much for raednig, as lnog as the frist and lsat lteter macth with the orignial wrod. So, for fun, what would be ...
Tomalak's user avatar
  • 941
57 votes
83 answers
9k views

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,557
53 votes
77 answers
8k views

The challenge is simple: Write a function or program that takes an input x, and outputs the lower case alphabet if x is part of ...
Stewie Griffin's user avatar
67 votes
52 answers
9k views

Every digital clock contains a small creature that has to advance the time every minute [citation needed]. Due to the popularty of digital clocks and the popularity of catching them in the wild, they ...
flawr's user avatar
  • 44.1k
48 votes
71 answers
9k views

The Challenge Output a list of years that starts with the current year and ends 120 years ago. The birth year of every living human would be included in this list. Details The list should be in ...
Christiaan Westerbeek's user avatar

15 30 50 per page
1
2 3 4 5 6