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
505 votes
932 answers
176k 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 ...
285 votes
73 answers
77k 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:...
  • 4,448
184 votes
386 answers
67k 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 ...
  • 22.8k
140 votes
27 answers
23k views

Appease Your Google Overlords: Draw the "G" Logo

Write a program or function that takes in a positive integer N, and outputs an N×N pixel image of Google's "G" logo according to this* construction: For example, if N is 400, a 400×...
130 votes
31 answers
20k views

A keyboard so real you can almost TASTE it

... Not that you would, would you? The task is simple, output the following text: ...
127 votes
200 answers
34k 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 ...
  • 2,021
118 votes
97 answers
17k 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 ...
  • 14k
116 votes
47 answers
14k 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 ...
's user avatar
115 votes
391 answers
29k 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 exact ...
  • 48.6k
115 votes
8 answers
5k views

Exponentially Slimy Programming: Stacking Minecraft Slimes

Slimes are cube shaped enemies in Minecraft that break into multiple smaller versions of themselves when killed. For the purposes of this challenge we'll depict them as an 8×8 pixel image with 3 ...
110 votes
81 answers
26k 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. ...
106 votes
12 answers
9k views

Proving that a Russian cryptographic standard is too structured

The aim of this challenge is to find an impossibly short implementation of the following function p, in the langage of your choosing. Here is C code implementing it ...
104 votes
90 answers
22k 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 must ...
  • 2,356
95 votes
87 answers
16k views

It was just a bug

Inspired by the bugged output in @Carcigenicate's Clojure answer for the Print this diamond challenge. Print this exact text: ...
95 votes
50 answers
14k 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 ...
92 votes
49 answers
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 ...
91 votes
170 answers
15k views

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 ...
's user avatar
91 votes
165 answers
21k views

"99 Bottles of Beer"

Write a program that outputs the lyrics to 99 Bottles of Beer, in as few bytes as possible. Lyrics: ...
  • 7,404
91 votes
124 answers
18k 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: ...
  • 1,019
86 votes
28 answers
8k views

Bake a slice of Pi

Write a program or function that prints or outputs this exact text (consisting of 142 characters): ...
  • 3,842
82 votes
45 answers
11k views

Fibonacci + Fizz Buzz = Fibo Nacci!

Fibonacci + FizzBuzz = Fibo Nacci! Your challenge is to create a Fibo Nacci program! A Fibo Nacci program outputs the first 100 Fibonacci numbers (starting from 1). If the Fibonacci number is ...
  • 12.8k
78 votes
62 answers
12k views

Draw the Ukrainian Flag

As you will probably know, there is a war going on in Ukraine. I noticed that it seems nobody has posted a Ukrainian flag challenge yet, so I thought I'd do it myself in support of Ukraine. The ...
  • 3,500
78 votes
32 answers
4k views

Output the PPCG Prime

This is the PPCG Prime 624 digits long ...
's user avatar
77 votes
66 answers
18k views

Sing Baby Shark

"Baby Shark" is a children's song about a family of sharks. Having long been popular as a campfire song, it has been popularized since the mid-2000s by social media, online video and radio. - ...
  • 997
77 votes
58 answers
13k views

War is peace. Freedom is slavery. Ignorance is strength

As George Orwell wrote in 1984: War is peaceFreedom is slaveryIgnorance is strength Write a program or function that takes in one of the six main words from the Orwell quote and outputs its ...
77 votes
19 answers
4k views

Golf Dennis a thermometer

Dennis puts in a huge amount of effort for this community, including as moderator, language designer, and provider of TIO. Unfortunately, his four-year-old daughter has caught a cold, so let us all ...
  • 28.3k
76 votes
91 answers
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: ...
  • 937
76 votes
15 answers
6k views

Error 404: Character Not Found

Scenario One of your friends is struggling on a homework assignment. He needs a simple program which prints the first 404 natural numbers: ...
  • 14k
76 votes
5 answers
7k 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 ...
75 votes
163 answers
10k views

Diagonal Alphabet

Given no input, your task is to generate the following: ...
  • 13.5k
74 votes
23 answers
8k views

Turtles All the Way Down

Write a program or function that takes in a positive integer and prints or returns a stack of that many ASCII-art turtles, where each turtle is larger than the one above it. Specifically, if the ...
73 votes
148 answers
18k 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: ...
  • 10.4k
73 votes
116 answers
9k views

Make an alphabet searchlight!

Inspired by a bug in a solution to this challenge, your challenge is to produce this exact text: ...
  • 13.3k
73 votes
22 answers
19k views

Draw the ☣ (Biohazard Symbol)

Draw the Biohazard symbol in an arbitrary colour on a distinctly coloured background. The specific proportions were published in the June 27th 1974 issue of the Federal Register of the US Government. ...
  • 43.2k
72 votes
200 answers
17k views

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 ...
72 votes
155 answers
13k 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 it ...
  • 90.4k
71 votes
71 answers
10k 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 ...
71 votes
22 answers
6k views

Interpreting Fish (no, not that Fish)

Consider these five ASCII art sea creatures: Standard fish: ><> or <>< Speedy fish: ...
70 votes
57 answers
14k views

Hare Krishna Hare Krishna Krishna Krishna Hare Hare

Recently, I've seen Hare Krishna people with their mantra on the emblem and I've found it may be quite interesting to code golf. The challenge Write the Hare Krishna mantra, i.e.: ...
70 votes
28 answers
19k views

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

The challenge: output this exact ASCII art of a spiderweb in a window: ...
70 votes
10 answers
6k views

Rock, Polyglot, Scissors

Write a program that is a polyglot in three languages that plays rock–paper–scissors. The input for any version of the program is always one of the strings rock or ...
69 votes
85 answers
11k views

Make the Mexican Wave

In as few bytes as possible, write a program or function that outputs the following: ...
  • 8,609
69 votes
20 answers
7k views

Automate Saving the World

You are Desmond Hume. For the last 3 years, you and your partner, Kelvin, have been slave to a computer that requires a very specific sequence to be entered into it every 108 minutes to save the world....
  • 57.4k
68 votes
125 answers
8k views

Print/Output the L-phabet

Inspired by George Gibson's Print a Tabula Recta. You are to print/output this exact text: ...
  • 48.6k
68 votes
17 answers
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: ...
  • 5,050
67 votes
16 answers
6k views

Output the full name of titin

Titin is a protein found in muscle tissue. It is a pretty big protein, and its full chemical name is giant as well. Comprising 189819 characters, the full name of titin would take about 3.5 hours to ...
  • 40.3k
66 votes
13 answers
5k views

ASCII Train Golf

Consider these seven ASCII train cars. Engine (E) __ ====== \/ | [] |========= | ) ================ O-O-O O-O-O \\ Passenger car (...
65 votes
20 answers
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 ...
  • 8,383
65 votes
16 answers
11k views

Draw the € sign

The goal is to output or display an image with an € (euro) sign according to the following specs (ignoring the border of the sign). Source: http://en.wikipedia.org/wiki/File:Euro_Construction.svg ...
  • 1,288
64 votes
62 answers
9k views

Write lines in detention

Introduction Bad news guys - you got detention. Your English teacher doesn't understand this site and wants you to "stop doing math on your digital dohickeys, this is English class!" She ...
  • 3,436

1
2 3 4 5
14