Linked Questions
78 questions linked to/from Showcase of Languages
465
votes
815answers
151k views
“Hello, World!”
So... uh... this is a bit embarrassing. But we don't have a plain "Hello, World!" challenge yet (despite having 35 variants tagged with hello-world, and counting). While this is not the most ...
600
votes
299answers
223k views
Produce the number 2014 without any numbers in your source code
Note to challenge writers as per meta consensus:
This question was well-received when it was posted, but challenges
like this, asking answerers to Do X without using
Y
are likely to be poorly received....
213
votes
380answers
51k views
Golf you a quine for great good!
Using your language of choice, golf a quine.
A quine is a non-empty computer program which takes no input and produces a copy of its own source code as its only output.
No cheating -- that means ...
130
votes
518answers
40k views
Shortest infinite loop producing no output
Your task is to create the shortest infinite loop!
The point of this challenge is to create an infinite loop producing no output, unlike its possible duplicate. The reason to this is because the code ...
156
votes
406answers
29k views
Implement a Truth-Machine
A truth-machine (credits goes to this guy for coming up with it) is a very simple program designed to demonstrate the I/O and control flow of a language. Here's what a truth-machine does:
Gets a ...
171
votes
333answers
53k 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 ...
384
votes
110answers
85k views
Most creative way to display 42
Douglas Adams was born on March 11, 1952, and died when he was just 49. In honor of this wonderful writer, I challenge you to display 42 in the most creative way possible.
You could print it in the ...
194
votes
212answers
43k views
The Programming Language Quiz
Congratulations to Dennis who won both the cops' and the robbers' challenge! Calvin's Hobbies has already delivered on his promise and wrote this challenge for Dennis for winning the robbers' ...
104
votes
337answers
25k 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 ...
128
votes
266answers
31k views
Fibonacci function or sequence
The Fibonacci sequence is a sequence of numbers, where every number in the sequence is the sum of the two numbers preceding it. The first two numbers in the sequence are both 1.
Here are the first ...
186
votes
158answers
18k views
What is the smallest positive base 10 integer that can be printed by a program shorter (in characters) than itself?
I think the question as above is clear, but just in case:
Write a full program (not just a function) which prints a positive base 10 integer, optionally followed by a single newline.
Qualifying ...
232
votes
78answers
77k views
Code that will only execute once
Goal
The goal of this challenge is to write code that will execute once and only once. This means basically that it damages the program, script, or environment in some way. If rebooting the system ...
91
votes
284answers
18k views
Simple cat program
One of the most common standard tasks (especially when showcasing esoteric programming languages) is to implement a "cat program": read all of STDIN and print it to STDOUT. While this is named after ...
91
votes
272answers
16k views
Create output twice the length of the code
The Challenge
Write a complete program that writes twice as many bytes to standard output as the length of the program.
Rules
The program must write ASCII characters to the standard output.
The ...
164
votes
127answers
32k views
Trick or Treat polyglot
Since Halloween is coming up I thought I might start a fun little code golf challenge!
The challenge is quite simple. You have to write a program that outputs either ...