Linked Questions
86 questions linked to/from Tips for golfing in R
192
votes
408
answers
72k
views
1, 2, Fizz, 4, Buzz
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 ...
84
votes
213
answers
22k
views
The Letter A without A
Your task is to display the letter "A" alone, without anything else, except any form of trailing newlines if you cannot avoid them, doing so in a program and/or snippet. Code that returns (instead of ...
92
votes
159
answers
13k
views
Determine whether strings are anagrams
Challenge
Given two strings, work out if they both have exactly the same characters in them.
Example
Input
word, wrdo
This returns true because they are the ...
63
votes
153
answers
15k
views
Print 0 to 100 without 1-9 characters
Print 0 to 100 without using characters 1,2,3,4,5,6,7,8,9 in your code.
Seperator of numbers can be comma, whitespace or newline.
Shortest code wins.
71
votes
100
answers
16k
views
Determine the color of a chess square
Your challenge is to write a program that outputs the color of a given square from the chessboard. This is how a chessboard looks:
You can see that the square a1 is dark, and h1 is a light square. ...
65
votes
103
answers
17k
views
Dad jokes are fun
We all know the classic dad joke that goes something like this:
Somebody says a sentence to describe their self (e.g. I'm tired or ...
57
votes
76
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^...
43
votes
85
answers
7k
views
Notcalc (Calculate the wrong answer)
Goal:
Given two natural numbers (integers from 0 to infinity), output a number that is not the sum of those numbers, but is a natural number.
Example solutions (TI-Basic):
...
65
votes
61
answers
9k
views
Convert YYYYMM to MMMYY
Basing on this SO question.
Challenge is rather simple: given a date period in the format YYYYMM output it in the format MMMYY.
...
42
votes
76
answers
5k
views
Print random integers until 0
You are to write a program which generates random integers between \$0\$ and \$99\$ inclusive, outputting each integer in turn, until \$0\$ is generated. You may choose which single-order random ...
53
votes
64
answers
7k
views
Multiplicative persistence
Multiplicative Persistence
Multiply all the digits in a number
Repeat until you have a single digit left
As explained by Numberphile:
Numberphile "What's special about 277777788888899?"
...
77
votes
38
answers
12k
views
Non-discriminating Programming
We say a string is non-discriminating if each of the string's characters appears the same number of times and at least twice.
Examples
"aa!1 1 !a !1" is non-...
71
votes
38
answers
12k
views
Enlarge ASCII art
In this challenge, you must take multiline ASCII art as input, such as:
...
26
votes
88
answers
8k
views
Swapping "Good" and "Bad"
Challenge Description:
Write a program that asks the user for input. The user will enter Good or Bad. You do not have to ...
81
votes
33
answers
4k
views
Output the PPCG Prime
This is the PPCG Prime
624 digits long
...