Questions tagged [kolmogorov-complexity]

Kolmogorov complexity, informally, is the amount of code it takes to describe or produce a constant object, such as a string or image. When posting a challenge in this category, please make sure it adds something new to existing challenges.

Filter by
Sorted by
Tagged with
405
votes
746answers
121k 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 ...
249
votes
63answers
69k views

We're no strangers to code golf, you know the rules, and so do I

Write the shortest program that prints the entire lyrics of "Never Gonna Give You Up" by Rick Astley. Rules: Must output the lyrics exactly as they appear in the above pastebin*. Here's the raw dump:...
56
votes
103answers
11k views

List of primes under a million

This is my first code golf question, and a very simple one at that, so I apologise in advance if I may have broken any community guidelines. The task is to print out, in ascending order, all of the ...
145
votes
256answers
37k 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 ...
74
votes
86answers
12k views

Print this diamond

This question has been spreading like a virus in my office. There are quite a variety of approaches: Print the following: ...
80
votes
133answers
12k views

Print a Tabula Recta!

Print a Tabula Recta! The Tabula Recta (sometimes called a 'Vigenere Table'), was created by Johannes Trithemius, and has been used in several ciphers, including all variants of Bellaso's Vigenere ...
71
votes
139answers
15k views

“99 Bottles of Beer”

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

I double the source, you double the output!

Your task, if you wish to accept it, is to write a program that outputs a positive integer (higher than 0). The tricky part is that if I duplicate your source code, the output must be double the ...
65
votes
120answers
13k views

The alphabet in programming languages

Our task is to, for each letter of the (English) alphabet, write a program that prints the alphabet, in a language whose name starts with that letter. Input: none Output: ...
47
votes
88answers
7k views

Alphabet triangle

You are to print this exact text: ...
43
votes
21answers
5k views

One Ring to rule them all. One String to contain them all

Objectives: Output a String which contains every positive integer strictly below 1000. The obvious answer would be to concatenate every one of them, and that would create a String of 2890 characters (...
64
votes
111answers
7k views

Print/Output the L-phabet

Inspired by George Gibson's Print a Tabula Recta. You are to print/output this exact text: ...
13
votes
6answers
1k views

Golf me an ASCII Alphabet

Don't you find that reading simple text isn't appealing enough? Try our ...
50
votes
25answers
7k views

Minecraft Mirrored

This is Calvin. Just trying to get 20 rep so this user can chat in the PPCG Minecraft Server chatroom. Write a program or function that takes in a positive integer. If the integer is even (2, 4, 6, ....
118
votes
177answers
29k views

Sing Happy Birthday to your favourite programming language

Your favourite programming language has just had a birthday. Be nice and sing it the Happy Birthday song. Of course you should accomplish this by writing a program in that language. The program takes ...
43
votes
37answers
14k views

Draw A Sierpinski Triangle

The Sierpinsky Triangle is a fractal created by taking a triangle, decreasing the height and width by 1/2, creating 3 copies of the resulting triangle, and place them such each triangle touches the ...
62
votes
17answers
6k views

Just repeat yourself

Write a program that outputs Do not repeat yourself! Your program code must respect the following constraints : its length must be an even number each ...
52
votes
9answers
3k views

Unfolding the Hexagony source code

Introduction If you're not familiar with Hexagony, it's an esoteric language created by Martin Büttner. The thing is that this language accepts multiple forms for the program. The following programs ...
65
votes
117answers
19k views

99 Bottles Of Beer [closed]

Recreate '99 bottles of beers on the wall'. The desired output is this: ...
58
votes
10answers
12k views

Draw the South Korean flag

When I stumbled upon this question I remembered that I had also once seen precise rules for the construction of the South Korean flag. And this is quite a different construction. Source: Wikipedia ...
105
votes
79answers
22k 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. ...
89
votes
44answers
13k views

In Honor of Adam West

Adam West passed away, and I'd like to honor his memory here on PPCG, though I doubt he knew of our existence. While there are many, many different things that this man is known for, none are more ...
82
votes
25answers
7k views

Bake a slice of Pi

Write a program or function that prints or outputs this exact text (consisting of 142 characters): ...
47
votes
15answers
5k views

ASCII Art of the Day #1 - Double Knot

Write a full program or a function that takes a positive integer N as input via STDIN/command line/ARGV or function arguments and prints an ASCII double knot ...
32
votes
9answers
2k views

Who's that Pokémon?

Input: an integer N between 1 and 151 Output: the Nth Pokemon. Rules You may use one data file. You may not use any already made data decompression algorithms. This includes libraries and other ...
31
votes
22answers
5k views

Golfing ASCII-art

Let's try to golf this piece of ascii-art representing a golfing man: '\ . . |>18>> \ . ' . | O>> ...
65
votes
65answers
9k views

This is my pillow

...will you help me immortalize it? I've had this pillow a few years now, and apparently it's time to get rid of it. Can you please write a function or program, that I can bring with me and use to ...
47
votes
13answers
6k views

Extreme Fibonacci

There have been a billion iterations of Fibonacci challenges on this website, so lets spice things up with a Fibonacci challenge of a billion iterations! Your challenge is to output the first 1000 ...
22
votes
23answers
3k views

There Was an Old Lady

Your goal is to write a program that prints the following poem exactly as it appears here: ...
12
votes
8answers
1k views

An Old Irish Blessing

I don't know who coined these words, and I'm not Irish, but I give you an Irish blessing: ...
77
votes
5answers
6k views

Recognise Stack Exchange Sites by Their Icon

After spending a while on Stack Exchange, I can recognise most sites in the Hot Network Questions by their little icon (which is also their favicon), but certainly not all of them. Let's write a ...
51
votes
43answers
7k views

Print all ASCII alphanumeric characters without using them

Challenge Print the following characters: abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890 The catch is that you may not use any one of them in ...
65
votes
152answers
9k views

Diagonal Alphabet

Given no input, your task is to generate the following: ...
38
votes
201answers
11k views

Print numbers from 1 to 10

This might be a very simple challenge, but I am surprised it hasn't been done on code-golf yet: Print all Integers from 1 to 10 inclusive in ascending order to standard output. Your output format ...
67
votes
17answers
9k views

Help Trump build the wall!

Trump needs the wall constructed and you are going to do it! To most efficiently build his wall I have created a simple, repeatable pattern for you to use: ...
47
votes
70answers
17k views

Convert 1, 2, 3, 4, 5, 6, 7, 8, and 9 to “one”, “two”, “three”, etc

Winner: professorfish's bash answer! An entire 9 bytes! Wow! You may continue to submit your answer, however you can no longer win. Original post kept for posterity: Your goal is to convert a whole ...
32
votes
10answers
10k views

Brainf*** Golfer

One of easiest code written by a programming language is a program printing sequence of characters (ex. "Hello, world!"). However, some esoteric programming languages like Brainfuck, even this ...
23
votes
8answers
2k views

Spell out numbers in French

There was a challenge to convert a number to its numeral in English, but that was too straightforward. Given a number 0–100, your task is to output the corresponding numeral in French. The French ...
28
votes
6answers
7k views

Let's draw the flag of Nepal

Nepal’s flag (Wikipedia, Numberphile) looks very different from any other. It also has specific drawing instructions (included in the Wikipedia article). I want you guys to make a program which will ...
29
votes
8answers
5k views

Print the American Flag!

Special Independence Day (USA) themed challenge for you today. You must write a program that prints this ascii-art representation of The American Flag. ...
6
votes
15answers
1k views

Alphabet Spiral

You are to write a program or function that outputs this exact text: OPQRSTU NQPONMV MREDCLW LSFABKX KTGHIJY JUVWXYZA IHGFEDCB May also be lowercase and trailing ...
17
votes
24answers
9k views

12 Days of Christmas Lyrics

I thought this would be a fun challenge for everyone and I'm curious to see the solutions people come up with. Print the "12 Days Of Christmas" lyrics ...
123
votes
28answers
17k views

A keyboard so real you can almost TASTE it

... Not that you would, would you? The task is simple, output the following text: ...
110
votes
42answers
13k views

It's my Birthday :D

Introduction Last year was my birthday (really!) and sadly I had to organise my own party. Well, now you know, couldn't you at least make the cake? Challenge Given an integer ...
106
votes
93answers
15k views

Loading… Forever

Your challenge is to make an infinite loading screen, that looks like this: Or, to be more specific: Take no input. Output Loading..., with a trailing space, but ...
65
votes
27answers
18k views

“As a child, I was told Spiders felt no emotion.”

The challenge: output this exact ASCII art of a spiderweb in a window: ...
106
votes
84answers
19k views

Draw the national flag of France

There have been many other flag challenges posted but not one for the national flag of France. This week seems like an appropriate time. Produce this flag in the fewest bytes possible: The image ...
73
votes
86answers
16k views

Build me a brick wall!

Challenge I need help building a brick wall! Throw together some code for me using no input and produce the following output wall shown below: ...
60
votes
210answers
8k views

The Mystery String Printer (Cops)

The robbers thread can be found here: The Mystery String Printer (Robbers) Your challenge Write a program, function, or REPL script that prints a string to STDOUT. The robbers will try to create a ...
90
votes
46answers
6k views

5 Favorite Letters

The challenge is actually extremely simple. Pick 5 distinct letters (you can just pick the 5 that allow you the shortest code if you like) and output them to the console. However, the twist is that ...