Linked Questions

423
votes
763answers
129k 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 ...
71
votes
186answers
13k views

Count up forever

Write a program that counts up forever, starting from one. Rules: Your program must log to STDOUT or an acceptable alternative, if ...
50
votes
125answers
8k views

Print all integers

Write a program or function which will provably print all integers exactly once given infinite time and memory. Possible outputs could be: ...
581
votes
276answers
213k 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 ...
46
votes
38answers
5k views

Fake Marquee Text

In this challenge fake marquee text is text that is shown part by part, in a scrolling-like fashion. Some examples: ...
44
votes
21answers
2k 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 ...
183
votes
144answers
17k 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 ...
151
votes
267answers
41k 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 ...
204
votes
337answers
45k 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 ...
45
votes
188answers
13k views

Add two numbers

Input: Two integers. Preferably decimal integers, but other forms of numbers can be used. These can be given to the code in standard input, as arguments to the program or function, or as a list. ...
149
votes
377answers
27k 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 ...
115
votes
239answers
27k 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 ...
161
votes
127answers
31k 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 ...
83
votes
270answers
22k 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 ...
14
votes
21answers
2k views

Do Matrix Multiplication!

In mathematics, matrix multiplication or the matrix product is a binary operation that produces a matrix from two matrices. The definition is motivated by linear equations and linear transformations ...

15 30 50 per page