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
452
votes
803answers
145k 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 ...
262
votes
64answers
72k 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:...
57
votes
106answers
13k 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 ...
164
votes
300answers
49k 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 ...
79
votes
151answers
18k views

“99 Bottles of Beer”

Write a program that outputs the lyrics to 99 Bottles of Beer, in as few bytes as possible. Lyrics: ...
80
votes
103answers
15k 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: ...
82
votes
143answers
13k 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 ...
72
votes
146answers
17k 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: ...
122
votes
190answers
32k 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 ...
45
votes
40answers
16k 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 ...
84
votes
26answers
7k views

Bake a slice of Pi

Write a program or function that prints or outputs this exact text (consisting of 142 characters): ...
49
votes
89answers
8k 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 (...
67
votes
117answers
8k views

Print/Output the L-phabet

Inspired by George Gibson's Print a Tabula Recta. You are to print/output this exact text: ...
50
votes
24answers
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, ....
17
votes
6answers
2k views

Golf me an ASCII Alphabet

Don't you find that reading simple text isn't appealing enough? Try our ...
93
votes
48answers
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 ...
96
votes
306answers
24k 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 learned when I started learning programming ~10 years ago. Task You are to print this ...
33
votes
9answers
3k 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 ...
65
votes
20answers
7k 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
4k 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 ...
18
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 ...
65
votes
117answers
20k views

99 Bottles Of Beer [closed]

Recreate '99 bottles of beers on the wall'. The desired output is this: ...
58
votes
10answers
13k 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 ...
46
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 ...
31
votes
22answers
6k views

Golfing ASCII-art

Let's try to golf this piece of ascii-art representing a golfing man: '\ . . |>18>> \ . ' . | O>> ...
70
votes
68answers
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 ...
24
votes
9answers
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 ...
23
votes
26answers
3k views

There Was an Old Lady

Your goal is to write a program that prints the following poem exactly as it appears here: ...
49
votes
13answers
7k 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 ...
14
votes
12answers
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: ...
128
votes
30answers
19k views

A keyboard so real you can almost TASTE it

... Not that you would, would you? The task is simple, output the following text: ...
113
votes
46answers
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 ...
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. ...
74
votes
86answers
17k 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: ...
92
votes
49answers
7k 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 ...
76
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 ...
69
votes
155answers
10k views

Diagonal Alphabet

Given no input, your task is to generate the following: ...
52
votes
50answers
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 ...
34
votes
11answers
12k 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 ...
50
votes
233answers
14k 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 ...
69
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: ...
52
votes
91answers
9k views

Print X without X (cop's thread)

This is the cop's thread of a cops-and-robbers challenge. You can view the robber's thread here A pretty common beginner style question is to print some string, but, there's a catch!, you need to do ...
48
votes
70answers
18k 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 ...
46
votes
58answers
3k views

Print the f × f times table

Your task is to print the hexidecimal times table: ...
28
votes
6answers
8k 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
6k 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. ...
24
votes
27answers
4k views

Output the Hebrew alphabet

Your task is to print this exact text: אבגדהוזחטיכךלמםנןסעפףצץקרשת (You are allowed to print a trailing newline) SHA256 hash of the UTF-8 encoding of the text: ...
14
votes
37answers
3k views

Print the Greek alphabet!

Fairly obviously, you have to print the Greek alphabet. But I thought I'd make it slightly more interesting, so there's a twist: when your program is ran with an argument (anything), it should output ...
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 ...

1
2 3 4 5 6