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
47 votes
46 answers
4k views

Extendify the ASCII Sun

Write a program that takes in (via STDIN/command line) a non-negative integer N. When N is 0, your program should print O (that's capital Oh, not zero). When N is 1,...
38 votes
35 answers
4k views

Zottffssentettffssen

Print or return the following string: zottffssentettffssenttttttttttttttttttttffffffffffffffffffffsssssssssssssssssssseeeeeeeeeennnnnnnnnno This is the first ...
517 votes
978 answers
192k 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 ...
54 votes
85 answers
8k views

Output Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo

Challenge The goal is to output Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo. Context. (Maybe another interesting challenge could be printing all ...
26 votes
41 answers
2k views

Create a Pride Flag

Challenge Create the image of a pride flag (rainbow flag), i.e. a six coloured striped flag (from top to bottom): red, orange, yellow, green, blue, and violet. Output Example (R) ...
38 votes
116 answers
6k views

Alphabet Staircase

The Challenge Your task is to create a program or function that outputs the following with no input: ...
74 votes
75 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 ...
27 votes
71 answers
6k views

1, 2, miss a few, 99, 100

When I was a kid, there was a "really cool" shortcut to count to 100: 1, 2, miss a few, 99, 100 Output the exact string above, in the fewest characters ...
87 votes
84 answers
15k views

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 ...
107 votes
97 answers
23k 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 ...
196 votes
416 answers
76k 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 ...
3 votes
9 answers
2k views

nimi ale lon toki pona! (Every word in Toki Pona!)

"nimi ale lon toki pona" is a song by YouTuber jan Misali which lists 137 common words in the constructed language Toki Pona. This challenge is not a duplicate of "How high can you ...
29 votes
9 answers
2k views

Golf Your Favorite Minecraft Tool

In Minecraft, the default item textures are all reasonably simple 16×16 pixel images, which makes them seem ideal for golfing. Below are simplified textures of the five "core" diamond tools in ...
44 votes
41 answers
7k views

Print a sinusoidal wave (vertically)

Print a continuous sinusoidal wave scrolling vertically on a terminal. The program should not terminate and should continuously scroll down the wave (except until it is somehow interrupted). You may ...
31 votes
35 answers
5k views

Help, I've mixed my week up!

My dog ate my calendar, and now my days are all mixed up. I tried putting it back together, but I keep mixing up the days of the week! I need some help putting my calendar back together, with the days ...
47 votes
44 answers
19k 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 ...
121 votes
409 answers
30k 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 ...
49 votes
25 answers
5k views

Ginormous number

Output this 1364-digit base-10 number: ...
72 votes
21 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....
60 votes
268 answers
17k 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 ...
8 votes
10 answers
671 views

Every nth prime number up to 8675309

Read this if you're confused. Challenge: The goal of this code-golf is based around the number 8675309... Your goal is to print out every prime number from 2 to ...
124 votes
105 answers
18k 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 ...
28 votes
54 answers
3k views

Confusing Alphabet Staircase

Given no input, output this interesting alphabet pattern in either case (the case has to be consistent) via an accepted output method: A AB ACBC ADBDCD AEBECEDE AFBFCFDFEF AGBGCGDGEGFG AHBHCHDHEHFHGH ...
100 votes
140 answers
21k 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: ...
6 votes
13 answers
787 views

The teacher is always wrong, flip his answer

Your dumb teacher is always wrong, so flip his answer. Change these responses True -> False Yes -> No 0 -> 1 Yeah -> Nope and vice versa. Keeping ...
43 votes
90 answers
5k views

A very long Terza Rima

Description Output the rhyme scheme for a very long Terza Rima. Input None. Output ...
96 votes
175 answers
23k views

"99 Bottles of Beer"

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

Backwards Alphabet Triangle

Without taking any input, output this exact text: ...
130 votes
208 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 ...
61 votes
36 answers
12k views

Print the phrase "And she said, 'But that's his.'" using only the alphabet

Print the phrase And she said, 'But that's his.' using only the following characters: ...
83 votes
46 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 ...
69 votes
129 answers
9k views

Print/Output the L-phabet

Inspired by George Gibson's Print a Tabula Recta. You are to print/output this exact text: ...
73 votes
211 answers
18k 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 ...
10 votes
5 answers
771 views

Find the Chess960 starting positions from its integer ID

Chess960, a.k.a. Fisher random chess, is a variation of the game of chess. In classic chess the starting positions are always the same. In chess960 they vary. Before each game of chess960 one random ...
23 votes
45 answers
4k views

Print the Christmas alphabet

Write a program to print or return one of these strings verbatim: abcdefghijkmnopqrstuvwxyz ABCDEFGHIJKMNOPQRSTUVWXYZ Notice that there is no L.
78 votes
170 answers
11k views

Diagonal Alphabet

Given no input, your task is to generate the following: ...
74 votes
164 answers
19k 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: ...
14 votes
8 answers
1k views

Write a Unicode Unpacker

We all know scoring by characters is ripe for abuse. Let's prove this. The Challenge Output the following: ...
47 votes
54 answers
15k views

Draw the Swiss Flag

Task: Output the Swiss flag. Happy Swiss National Day / Schweizer Bundesfeiertag / Fête nationale suisse / Festa nazionale svizzera / Fiasta naziunala svizra! Details: The flag consists of a white ...
100 votes
92 answers
17k 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: ...
77 votes
119 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: ...
31 votes
81 answers
4k views

Print the ASCII Code page

Goal You have to print the ASCII printable characters' code page (0x20-0x7E). The output should look like this: ...
75 votes
61 answers
16k 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.: ...
38 votes
120 answers
5k views

Numbers by Position

Challenge Print the numbers: 1 22 333 4444 55555 666666 7777777 88888888 999999999 In that order. I/O Takes no input. The numbers can have any delimiters desired (...
20 votes
25 answers
5k views

First person to ever beat Classic Tetris

Historic Tetris Achievement Blue Scuti became the first ever human to beat the classic game of Tetris on NES. Here's the Tetris Kill Screen Challenge Output the following Tetris ...
42 votes
46 answers
3k views

A Programming Puzzle of Mode Golf

Your task is to print the text Good morning, Green orb!, with every character repeated in place as many times as the most frequent byte in your source (the mode). ...
62 votes
18 answers
11k views

Let's draw Mona Lisa

In 2014, demoscener Jakub 'Ilmenit' Debski released a 250-byte(1) procedural graphics demo for the Atari XL called Mona. It's drawing the following picture(2): Your task is to generate the exact same ...
26 votes
28 answers
4k views

Even and Odd Numbers

Sandbox Adapted from exercise 4 of 100 little Keg exercises The ability to repeat chunks of code within a program is an important part of any programming language. Also just as important is the ...
53 votes
53 answers
8k 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 ...
30 votes
51 answers
9k views

Charlie, Oscar, Delta, Echo

A big part of radio communication is the NATO Phonetic Alphabet, which encodes letters as words to make them easier to understand over comms. Your job, if you wish to accept it, is to print them one ...

1
2 3 4 5
14