Skip to main content

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
522 votes
985 answers

"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 ...
Martin Ender's user avatar
289 votes
73 answers

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:...
Polynomial's user avatar
  • 4,506
65 votes
115 answers

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 ...
Delan Azabani's user avatar
196 votes
416 answers

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 ...
Beta Decay's user avatar
  • 23.4k
96 votes
174 answers

"99 Bottles of Beer"

Write a program that outputs the lyrics to 99 Bottles of Beer, in as few bytes as possible. Lyrics: ...
GamrCorps's user avatar
  • 7,592
101 votes
140 answers

Print this diamond

This question has been spreading like a virus in my office. There are quite a variety of approaches: Print the following: ...
Eric Wilson's user avatar
  • 1,119
95 votes
173 answers

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 cipher and the Trithemius ...
user avatar
69 votes
129 answers

Print/Output the L-phabet

Inspired by George Gibson's Print a Tabula Recta. You are to print/output this exact text: ...
Leaky Nun's user avatar
  • 49.8k
88 votes
28 answers

Bake a slice of Pi

Write a program or function that prints or outputs this exact text (consisting of 142 characters): ...
Copper's user avatar
  • 3,930
74 votes
164 answers

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: ...
Joey Adams's user avatar
  • 10.6k
130 votes
208 answers

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 ...
David Frank's user avatar
  • 2,444
52 votes
96 answers

Alphabet triangle

You are to print this exact text: ...
Leaky Nun's user avatar
  • 49.8k
47 votes
44 answers

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 ...
Kibbee's user avatar
  • 959
45 votes
21 answers

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 (...
Fabinout's user avatar
  • 643
96 votes
52 answers

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 ...
Magic Octopus Urn's user avatar
73 votes
211 answers

The Programming Language Quiz, Mark II - Cops

A repost of this challenge. Meta discussion. Sandbox post. Body of the question similar to the original Robber's challenge This cops and robbers is now (08/03/2018) closed to further competing cop ...
caird coinheringaahin g's user avatar
50 votes
24 answers

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, ....
Old Chat Relay's user avatar
122 votes
413 answers

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 ...
Leaky Nun's user avatar
  • 49.8k
95 votes
49 answers

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 ...
Magic Octopus Urn's user avatar
73 votes
155 answers

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 it ...
Wheat Wizard's user avatar
  • 98.8k
67 votes
20 answers

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 ...
Arnaud's user avatar
  • 8,533
57 votes
16 answers

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 ...
user1502040's user avatar
  • 3,829
53 votes
11 answers

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 ...
Adnan's user avatar
  • 44.4k
34 votes
9 answers

Who's that Pokémon? [closed]

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 ...
cardboard_box's user avatar
29 votes
31 answers

There Was an Old Lady

Your goal is to write a program that prints the following poem exactly as it appears here: ...
Ethan Roseman's user avatar
25 votes
26 answers

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 ...
macek's user avatar
  • 369
17 votes
6 answers

Golf me an ASCII Alphabet

Don't you find that reading simple text isn't appealing enough? Try our ...
Katenkyo's user avatar
  • 3,125
78 votes
170 answers

Diagonal Alphabet

Given no input, your task is to generate the following: ...
Stephen's user avatar
  • 14k
74 votes
75 answers

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 ...
Stewie Griffin's user avatar
62 votes
117 answers

99 Bottles Of Beer [closed]

Recreate '99 bottles of beers on the wall'. The desired output is this: ...
Nick Berardi's user avatar
61 votes
12 answers

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 ...
Martin Ender's user avatar
46 votes
16 answers

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 ...
Optimizer's user avatar
  • 26.5k
45 votes
142 answers

Print X without X (robber's thread)

This is the robber's thread of a cops-and-robbers challenge. You can view the cop's thread here A pretty common beginner style question is to print some string, but, there's a catch!, you need to do ...
Wheat Wizard's user avatar
  • 98.8k
37 votes
41 answers

Print a string in as few distinct characters as possible

The task is simple: print The quick brown fox jumps over the lazy dog using as few distinct characters in your source code as possible. ...
ashastral's user avatar
  • 2,634
32 votes
22 answers

Golfing ASCII-art

Let's try to golf this piece of ascii-art representing a golfing man: '\ . . |>18>> \ . ' . | O>> ...
xem's user avatar
  • 5,825
29 votes
6 answers

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 ...
ST3's user avatar
  • 1,359
29 votes
8 answers

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. ...
DJMcMayhem's user avatar
  • 59.3k
28 votes
9 answers

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 ...
NinjaBearMonkey's user avatar
17 votes
48 answers

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 ...
user avatar
14 votes
12 answers

An Old Irish Blessing

I don't know who coined these words, and I'm not Irish, but I give you an Irish blessing: ...
Joey Adams's user avatar
  • 10.6k
134 votes
32 answers

A keyboard so real you can almost TASTE it

... Not that you would, would you? The task is simple, output the following text: ...
Magic Octopus Urn's user avatar
118 votes
47 answers

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 ...
user avatar
113 votes
88 answers

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. ...
insertusernamehere's user avatar
107 votes
97 answers

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 must ...
steve's user avatar
  • 2,414
77 votes
5 answers

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 ...
Martin Ender's user avatar
75 votes
91 answers

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: ...
Dylan's user avatar
  • 935
70 votes
170 answers

Print 0 to 100 without 1-9 characters

Print integers 0 to 100 (inclusive) without using characters 123456789 in your code. Separator of numbers can be comma or white space (by default <blank>, <...
user avatar
68 votes
17 answers

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: ...
J Atkin's user avatar
  • 5,090
53 votes
53 answers

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 ...
anna328p's user avatar
  • 6,396
50 votes
73 answers

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 ...
Jon's user avatar
  • 1,543

2 3 4 5