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
515 votes
966 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
193 votes
412 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.2k
141 votes
27 answers

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×...
Calvin's Hobbies's user avatar
131 votes
31 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
128 votes
201 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,039
121 votes
402 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.5k
120 votes
98 answers

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 ...
FlipTack's user avatar
  • 14.6k
117 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
112 votes
87 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
12 answers

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 ...
picarresursix's user avatar
106 votes
96 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,394
100 votes
90 answers

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: ...
Kevin Cruijssen's user avatar
96 votes
51 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
95 votes
131 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,059
94 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
93 votes
171 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
93 votes
168 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,502
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,890
83 votes
79 answers

Draw the Ukrainian Flag

As you 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 Challenge ...
Ginger's user avatar
  • 5,390
82 votes
45 answers

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 ...
user41805's user avatar
  • 13k
81 votes
33 answers

Output the PPCG Prime

This is the PPCG Prime 624 digits long ...
user avatar
79 votes
59 answers

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 ...
Calvin's Hobbies's user avatar
77 votes
66 answers

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. - ...
njha's user avatar
  • 987
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
77 votes
19 answers

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 ...
Adám's user avatar
  • 29.8k
76 votes
165 answers

Diagonal Alphabet

Given no input, your task is to generate the following: ...
Stephen's user avatar
  • 13.7k
76 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
  • 937
76 votes
15 answers

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: ...
FlipTack's user avatar
  • 14.6k
75 votes
22 answers

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. ...
flawr's user avatar
  • 43.6k
74 votes
156 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
74 votes
23 answers

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 ...
Calvin's Hobbies'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
  • 95.6k
73 votes
60 answers

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.: ...
Dariusz Woźniak's user avatar
73 votes
116 answers

Make an alphabet searchlight!

Inspired by a bug in a solution to this challenge, your challenge is to produce this exact text: ...
MD XF's user avatar
  • 13.7k
73 votes
22 answers

Interpreting Fish (no, not that Fish)

Consider these five ASCII art sea creatures: Standard fish: ><> or <>< Speedy fish: ...
Calvin's Hobbies's user avatar
72 votes
207 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
71 votes
71 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
70 votes
28 answers

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

The challenge: output this exact ASCII art of a spiderweb in a window: ...
Kevin Cruijssen's user avatar
70 votes
10 answers

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 ...
Calvin's Hobbies's user avatar
69 votes
85 answers

Make the Mexican Wave

In as few bytes as possible, write a program or function that outputs the following: ...
absinthe's user avatar
  • 8,619
69 votes
20 answers

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....
DJMcMayhem's user avatar
  • 58.8k
68 votes
125 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.5k
68 votes
16 answers

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 ...
hyper-neutrino's user avatar
  • 41.1k
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,070
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,493
66 votes
13 answers

ASCII Train Golf

Consider these seven ASCII train cars. Engine (E) __ ====== \/ | [] |========= | ) ================ O-O-O O-O-O \\ Passenger car (...
Calvin's Hobbies's user avatar
65 votes
113 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
65 votes
16 answers

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: ...
A.L's user avatar
  • 1,288
64 votes
62 answers

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 ...
hmatt1's user avatar
  • 3,436

2 3 4 5