Linked Questions

130
votes
515answers
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 ...
82
votes
154answers
19k views

“99 Bottles of Beer”

Write a program that outputs the lyrics to 99 Bottles of Beer, in as few bytes as possible. Lyrics: ...
109
votes
79answers
24k views

Draw the national flag of Iceland

This year's UEFA Euro 2016 is over and besides a couple of negative headlines there has been a very positive surprise as well – the Iceland national football team. Let's draw their national flag. ...
46
votes
139answers
15k views

Output programming language name

Challenge: In the programming language of your choice, take no input and output your programming language's name. Fair enough, right? Restrictions: You can't use any character that is included in ...
43
votes
106answers
16k views

Is this number evil?

Introduction In number theory, a number is considered evil if there are an even number of 1's in its binary representation. In today's challenge, you will be identifying whether or not a given number ...
112
votes
32answers
17k views

Blink the CAPS LOCK

Most computer keyboards feature a small integrated LED light, indicating the current input mode, as controlled with the CAPS LOCK button. Your task is to blink it: Turn it on; Wait for 0.5 (+/-0.1) ...
103
votes
37answers
7k views

Source code ecological footprint

You've just been hired by a German car manufacturing company. Your first task, as an engineer, is to write a program that computes the ecological footprint of ASCII strings. The ecological footprint ...
40
votes
88answers
6k views

Print an alphabet wave

You are to print this exact text: ...
30
votes
87answers
8k views
+50

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.
31
votes
97answers
5k views

Alphabet Staircase

The Challenge Your task is to create a program or function that outputs the following with no input: ...
48
votes
51answers
8k views

Blue duck, red duck, gray duck

So, last week I posted a challenge to play Duck, Duck, Goose. This lead to a number of Minnesotans commenting about their regional 'Gray duck' variation. So here's the rules: Using this list of ...
73
votes
34answers
11k views

Wait a minute – in less than ten seconds

Task Using any type of parallelisation, wait multiple periods, for a total sleep time of at least a minute (but less than a minute and a half). The program/function must terminate within 10 seconds ...
46
votes
38answers
10k views

Retina or Trash?

We live in a wonderful age of technology where we can have beautifully detailed 8K screens on our TVs, and even 2K displays on our phones for our mobile browsing pleasure. We've come a long way in ...
31
votes
70answers
8k views

Randomizing until 0

Challenge Sandbox post Given a positive integer (K) Output a uniformly-random integer (Y) between ...
32
votes
62answers
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. ...
42
votes
48answers
9k views

We had a question once which only failed on Sundays

Inspired by We had a unit test once which only failed on Sundays, write a program or function that does nothing but throw an error when it is Sunday, and exit gracefully on any other day. Rules: No ...
52
votes
32answers
9k views

Generate a mandelbrot fractal [closed]

Your task is to draw the mandelbrot set in ascii. It should look something like The complex number c lies in the mandelbrot set, when the sequence ...
47
votes
30answers
11k views

Pixel-art, episode 1: display Super Mario

it's a-me! Today's task is simple: write a program, or a function that displays the idle small Mario sprite, from Super Mario Bros, on NES, over a blue background. Any kind of entry is valid as long ...
27
votes
40answers
3k views

Making an acronym

Objective Your goal is to make a program that converts an input to its acronym. Your input is guaranteed to have only letters and spaces. The input will have exactly one space between words. You must ...
30
votes
27answers
7k views

Output a Super Mario Image

This is a problem on Luogu OJ. I decided to post it here because on Luogu OJ, many people, including me and my friend, are interested about how to solve this problem within the fewest characters. ...
30
votes
36answers
2k views

Sort the unique numbers in a multiplication table

Pretty simple challenge today: Write a program or function that takes in a positive integer N and prints or returns a sorted list of the unique numbers that appear in the multiplication table whose ...
30
votes
30answers
4k views

Make me a fake loader

Make a fake loader just like this : Parameters : Display loading (space) one of these cyclically-\|/ (space) (percentage ...
17
votes
46answers
2k views

IPv4 Integer Conversion Function

Write the shortest function to convert an IP address into it's integer representation and output it as an integer. To change an IPv4 address to it's integer representation, the following calculation ...
39
votes
26answers
2k views

ASCII clock with dot & comma time markers

Introduction Imagine that line of chars is in fact two rows. Upper row - dots - represents hours (24 hour system), while lower - commas - represents minutes. One character can represent hour, minute ...
41
votes
13answers
5k views

Advanced Code Golf - Write a small HTTP server

Your challenge is to write a code-golf HTTP server that accepts GET requests. It obviously doesn't have to be fully featured, but it must serve files from a directory. Rules: The HTTP server must ...
18
votes
27answers
2k views

Count Up, Replace, Repeat!

Definition Define the nth array of the CURR sequence as follows. Begin with the singleton array A = [n]. For each integer k in A, replace the entry k with k natural numbers, counting up from 1 to k. ...
18
votes
35answers
2k views

Recover the power from the prime power

It seems that many people would like to have this, so it's now a sequel to this challenge! Definition: a prime power is a natural number that can be expressed in the form pn where p is a prime and n ...
10
votes
62answers
1k views

Given an int input n, print out n*reversed(n)

Given an integer n, print out n * reversed(n) reversed(n) is the number you get when you <...
19
votes
34answers
3k views

Text compression

With the given text below, there are some words in the text that repeats several times in the text. Use any programming language to write a short code that compresses the text to display it. Or in ...
33
votes
15answers
3k views

An Ant on a Cube

An ant walks along the edges (not faces) of a wireframe cube. Each vertex it encounters presents it with a fork from which two new edges branch off. The ant chooses which way to turn -- ...

15 30 50 per page