Kolmogorov complexity, informally, is the amount of code it takes to produce a given string of text. When posting a challenge in this category, please make sure it adds something new to the challenges that already exist.
6
votes
3answers
318 views
Help me with trigonometry!
Thank you guys so much for your help with calculus. Now I need some help with my upcoming trigonometry test.
On the test, I'll need to simplify expressions. I’ll be given input like 4sin(x)/(2cos(x)) ...
14
votes
2answers
1k views
Draw ASCII Playing Cards
Consider these 15 ASCII playing card patterns (ace through Joker, and the back side), where X is a placeholder for the suit symbol: (they look better with less line spacing)
------------- ...
8
votes
5answers
747 views
Monkey Island: The Head of the Navigator
Warning: This challenge contains some mild spoilers for The Secret of Monkey Island.
Towards the end of the game, you're being led through the catacombs by a magically preserved head of a navigator:
...
8
votes
3answers
369 views
Pigpen Cipher Encryption
Pigpen Cipher Encryption
Your mission is simple: to write a program which receives text as input and outputs an ASCII representation of it in the Pigpen Cipher.
Input
ASCII-only (no Unicode) ...
13
votes
6answers
656 views
Electron Configurations
Electron Configurations
Your mission is to accept an element's atomic number as input, and output its electron configuration (e.g. 2,8,8,2 for calcium).
Input
An atomic number from 1 to 118. You ...
12
votes
6answers
937 views
Integer Emotions
Write a program or function that "reacts" to a given integer n (input via function parameter/args/stdin)
The program doesn't care about negative numbers, likes even, dislikes odd numbers and ...
6
votes
2answers
290 views
Counting rods; count your rods
Some background
Counting rods are small bars (3-14 cm long) that were used by mathematicians from many asian cultures for more than 2000 years to represent any whole number or fraction. (In this ...
27
votes
30answers
9k views
Output the legendary Yggdrasil
Your task is to output a representation of the legendary tree of life, Yggdrasil.
You must write a program whose output is exactly that :
/\
...
15
votes
2answers
608 views
DNA: Deoxyribonucleic ASCII
Given a sequence of the bases Adenine, Cytosine, Guanine and Thymine (encoded as ACGT), you're to produce an ASCII art representation of a corresponding double strand of DNA.
The strand will extend ...
40
votes
6answers
1k views
ASCII Art Calendar
Let's make an ASCII art clock and calendar that tells us the current month, day of the month, day of the week, hour, minute, and whether it's night or day (but not the year or second).
At any ...
15
votes
8answers
1k views
Draw the Stickman Wars
Picture of me drafting this challenge with my advanced drawing skills.
Background
The Stickman wars happened long ago, when Earth's dominant species was made of nothing but sticks. Historians ...
13
votes
15answers
2k views
Output Graham's Number
Write a program that outputs all 64 layers of this representation of Graham's number from Wikipedia:
Your output must exactly match this ASCII version (in which ^ represents Knuth's ...
11
votes
11answers
3k views
Make me an alphabet tree
Intro
In most fonts all of the uppercase alphabet characters besides BDO have single lines approximately touching some of the four corners of the character's bounding rectangle: ...
18
votes
2answers
2k views
Fill the Screen with Wang Tiles
It has been proven that the following 13 square Wang tiles always tile the plane aperiodically. This means that when the squares are arranged in a grid with all neighboring sides the same color, a ...
10
votes
10answers
823 views
Quoting Big Brother
Task: Have your program randomly choose one of the following two quotes at runtime and print that one quote, exactly as shown.
1:
Under the spreading chestnut tree
I sold you and you sold me.
There ...
10
votes
2answers
422 views
Write a book writer
Here is a fairly simple ASCII depiction of an open book:
|\
| \
| \
| \
| \__________
| || |
| || Lorem i |
\ || psum do |
\ || lor sit |
\ || amet, |
\ || consect |
...
27
votes
46answers
6k views
The Real Slim Shady
Echo the following in as few bytes as possible:
I'm Slim Shady. Yes, I'm the real Shady.
All you other Slim Shadys are just imitating.
So, won't the real Slim Shady please stand up?
Please stand up. ...
12
votes
8answers
972 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 ...
10
votes
8answers
931 views
What is your star-sign?
Write a program that takes a birth date (month and day-of-month) as input and outputs the corresponding sign, element and quality of the western zodiac. For the purposes of this challenge, these are ...
38
votes
9answers
2k views
ASCII Train Golf
Consider these seven ASCII train cars.
Engine (E)
__
====== \/
| [] |=========
| )
================
O-O-O O-O-O \\
Passenger car (P)
===============
| [] [] [] ...
10
votes
2answers
677 views
Who wants to be a Kolmogorov complexity winner?
You mission today is to invent a text compressor.
Task
You'll write two functions:
The packer is a function that accepts a string of ASCII characters (U+0000 to U+007F) and outputs a Unicode ...
41
votes
46answers
6k views
Rock Around the Clock
In as few Unicode characters as possible, print the following (144 characters):
1, 2, 3 o'clock, 4 o'clock rock,
5, 6, 7 o'clock, 8 o'clock rock,
9, 10, 11 o'clock, 12 o'clock rock,
We're gonna rock ...
25
votes
20answers
3k views
Golfing ASCII-art
Let's try to golf this piece of ascii-art representing a golfing man:
'\ . . |>18>>
\ . ' . |
...
0
votes
2answers
205 views
Low Entropy Literature [duplicate]
This is one of my favourite poems I wanted to share. Especially because it looks good for compressing. Who cares about literature in the 21st century anyway.
Goal
Your goal is to write the shortest ...
38
votes
65answers
10k 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 ...
5
votes
1answer
304 views
What a wonderful world [duplicate]
The challenge is programming a program that prints following lyrics of Louis Armstrong's 'What A Wonderful World' with as few characters as possible. The key is obviously kind of a 'compression'. I ...
15
votes
22answers
4k views
Old MacDonald function
Create a function in your chosen language that prints out the following:
Old MacDonald had a farm, E-I-E-I-O,
And on that farm he had a cow, E-I-E-I-O,
With a moo moo here and a moo moo there,
Here a ...
23
votes
4answers
3k views
May the 4th be with you!
In honor of Star Wars day, write a program to display the following text, scrolling like the Star Wars opening crawl:
It is a period of civil war. Rebel
spaceships, striking from a hidden
...
29
votes
9answers
3k views
Kolmogorov-mania
The Kolmogorov complexity of a string s is defined as the length of the shortest program P that outputs s. If the length of P is shorter than the length of s, then s is said to be compressible, ...
2
votes
1answer
322 views
Determining part of speech of most words [closed]
Write a program to output the part of speech of any word inputted to it. I doubt that anyone could get a perfect algorithm, so I will give the code a batch of words in order to ascertain what ...
10
votes
10answers
659 views
Find all times that follow a pattern
Your job is write a program that prints all times (in the format HH:MM, 24 hours) that follow any of the following patterns:
Hours equal to minutes, e.g. 22:22,01:01
Hours equal to reverse minutes, ...
10
votes
17answers
769 views
Calculate 6*9 in different bases
Output the following result (which is a result of calculating 6 * 9 in bases from 2 to 36). Make sure letters are uppercase, and the multiplication itself is outputed on every line.
6 * 9 = 110110
6 ...
8
votes
2answers
455 views
Type out Green Eggs and Ham in vim
The book Green Eggs and Ham by Dr. Seuss is famous for only having 50 different words in the entire story of the book.
Your task is to create a sequence of keystrokes that will result in the entire ...
2
votes
6answers
592 views
How random is the Gettysburg Address
Your program must print out the Gettysburg Address.
I copied this text from Wikipedia:
Four score and seven years ago our fathers brought forth on this continent a new nation, conceived in ...
11
votes
7answers
856 views
Build a “BizzFuzz” program
In traditional FizzBuzz, you are asked to print the numbers from 1 to 100, but replacing every multiple of 3 with "Fizz", every multiple of 5 with "Buzz", and every multiple of both 3 and 5 (i.e. 15) ...
7
votes
14answers
850 views
Generate a Universal-binary-function Lookup Table
This is tangentially related to my quest to invent an esoteric programming language.
A table of the binary numbers 0 .. 15 can be used to implement a Universal Binary Function using indexing ...
3
votes
3answers
446 views
Print element from the periodic table [duplicate]
Your task is simple: given a number as an input, you have to print the English name of the chemical element with that atomic number, up to and including ununoctium. For example, for an input of 77, ...
19
votes
14answers
4k views
Count from 1 to 100… in Roman Numerals
Write a program that count from 1 to 100 in Roman Numerals and print these numbers by standard output. Each one of the numbers must be separated by spaces.
You cannot use any built in function to ...
6
votes
5answers
955 views
Normal distribution values
Write the shortest program possible which outputs a table of Normal distribution values
phi(z) = Integral[t from -infty to z of e^(-t^2/2) /sqrt(2 pi) dt]
for z from 0.00 to 3.99, giving values ...
16
votes
5answers
1k 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 ...
10
votes
19answers
2k views
Smile! Just smile
It's well known that Brainf*ck is very bad at Kolmogorov-complexity problems, for example, it requires around 100 characters just to print "Hello world".
However, there might be texts where Brainf*ck ...
22
votes
37answers
3k 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
121
12321
1234321
123454321
12345654321
...
7
votes
12answers
909 views
Generate the names of the keys on a piano
On a standard 88 key piano, each key has a scientific name.
The first three keys are A0, B♭0, and B0. The keys then proceed through C1, D♭1, D1, E♭1, E1, F1, G♭1, G1, A♭1, A1, B♭1, B1, and start over ...
139
votes
53answers
52k 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 ...
35
votes
7answers
5k views
Write the shortest program that generates the most compiler warnings and errors
The challenge:
Write a very short program that, when compiled, creates the most amount of compiler warnings and errors. It can be written in any programming language.
Scoring:
The score is ...
10
votes
2answers
1k views
Shortest ELF for “Hello world\n”?
Is it possible to write (pack) a shorter than 145 bytes version of a program with "Hello world" (plus new line) output if the length of the program is measured as a number of bytes in program's ELF ...
14
votes
15answers
962 views
Calculate a user's privileges on CodeGolf.SE
The Challenge
Your goal is to write the shortest program possible that will take a list of events (such as upvote, downvote, etc) and return the user's reputation and the privileges that he has ...
14
votes
6answers
2k views
Brainfuck 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 ...
10
votes
8answers
840 views
Encode an image inside of the source
The golf challenge is to encode and compress the following image inside a source file.
To do this you need to write 3 functions: red, green, and blue which accept x/y coordinates of the image and ...
12
votes
6answers
748 views
Generate Random Boggle Board
Generate a 4x12 grid of letters / spaces:
Each die should appear precisely once, location randomly chosen. Locations should be approximate a uniform random permutation of the dice. Display a random ...