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
9
votes
9answers
2k views

Have you mooed today?

The Debian Linux distribution (and Debian-based distros, like Ubuntu, Kali and others) uses a package-manager called APT. To install program foo you would type into ...
84
votes
161answers
19k views

“99 Bottles of Beer”

Write a program that outputs the lyrics to 99 Bottles of Beer, in as few bytes as possible. Lyrics: ...
273
votes
68answers
74k 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:...
472
votes
848answers
155k 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 ...
34
votes
30answers
3k views

Print a tongue twister!

The goal of this challenge is to print the following tongue twister: ...
105
votes
342answers
25k 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 ...
34
votes
101answers
10k views

Print 0 to 100 without 1-9 characters

Print 0 to 100 without using characters 1,2,3,4,5,6,7,8,9 in your code. Seperator of numbers can be comma, whitespace or newline. Shortest code wins.
45
votes
148answers
15k views

Output programming language name

Challenge: In the programming language of your choice, take no input and output your programming language's name. Fair enough, right? Restrictions: You can't use any character that is included in ...
24
votes
10answers
877 views

Raindrops are falling on my… glasses?

I live in the UK, where it rains. A lot. I also have the unfortunate necessity to need to wear glasses to see, which means that when it rains (as it is now), I can barely see out of them. This ...
31
votes
86answers
4k views

Numbers by Position

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 ...
49
votes
16answers
7k 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 ...
51
votes
57answers
15k views

Print “N NE E SE S SW W NW”

This seems almost trivial, but since after some effort I was not able to beat the literal solution in J, I thought it might make a decent challenge (though, to be clear, this is not a J-specific ...
9
votes
7answers
571 views

Put on your sunglasses

Introduction You are probably familiar with the "puts on sunglasses" emoticon-meme: (•_•) ( •_•)>⌐■-■ (⌐■_■) In this challenge, your task is to take the ...
37
votes
14answers
5k views

Picture of an old friend in ASCII art

I hope this picture looks familiar to you. It's one of Pacman's ghosts in his "vulnerable" state, after Pacman has eaten a power pill. The challenge Picture our ghost in a little frame, using ASCII ...
114
votes
95answers
16k 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 ...
16
votes
7answers
2k views

Output 2015 as QR code

Mission is simple. Just output number 2015 as QR code and write it to file named newyear.png in PNG format. Code must be valid any day, so maybe you shall not use ...
27
votes
29answers
5k views

Output a Sudoku board

Today's challenge is simple: Without taking any input, output any valid sudoku board. In case you are unfamiliar with sudoku, Wikipedia describes what a valid board should look like: The objective ...
4
votes
17answers
404 views

Any digital permutation

Task Your task is to output a single integer, with one restriction: its digits must be a permutation of [1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 5, 5, 5, 6, 6]. For example, you could output 653443653152432, ...
2
votes
15answers
2k views

Drawing the Stack Overflow logo

From here. Every new game is the first day of the month, 12:00 PM UTC. The goal is to create the Stack Overflow logo using ASCII characters. It looks like this. The exact output should look like this:...
2
votes
17answers
602 views

Implement Smokey's !!/coffee command. (Part 2)

Like the previous SmokeDetector challenge? This one is for you too ;) Note: SmokeDetector is a bot that detects spam and offensive posts on the network and posts alerts to chat. What to implement ...
49
votes
45answers
4k views

Removing The Nineteenth Byte

Introduction The Nineteenth Byte is CGCC's official chatroom (go check it out!). Its name is a play on the nineteenth hole, and it also refers to golf, which is appropriate for CGCC's chatroom's name. ...
5
votes
16answers
742 views

Prime Challenge

CODE GOLF & Coding Challenges: In today's challenge, you'll be asked to print the following very special AND tricky AND satisfying Prime Number...! Are you golfers ready? ...
9
votes
20answers
2k views

Ascii smiley face challenge

I made this because, although we have a bunch of other questions involving smiley faces, there is nothing for just printing an ASCII smiley face with as little code as possible. Anyway, print this ...
22
votes
58answers
5k 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 ...
-4
votes
12answers
422 views

Rocket Liftoff!

This code golf challenge is about making a rocket liftoff sequence. Your output (STDOUT) should be equal to this: ...
25
votes
22answers
3k views

Help me compress this song

in my country we have a children's song which goes like this: ...
20
votes
37answers
2k views

Print a conversion table for (un)signed bytes

Your task: Print or return a conversion table with every byte from 00 to ff's value as an unsigned integer, to its value as a ...
-4
votes
14answers
217 views

Lists of power!

Generate the following list of lists consisting of the unique last digits of the powers from 1 to 9 for the numbers [0..9] ...
49
votes
57answers
6k views

There are known knowns

Former US Secretary of Defense, Donald Rumsfeld, famously popularized the phrase "known knowns." Here we're going to distill his remarks into a four-line stanza. Specifically, output this text: <...
88
votes
81answers
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: ...
10
votes
26answers
2k views

Let's play tennis 2: east-west game

There is a challenge Let's play tennis by Daniel. He proposes to place a court in the North-South direction. My proposal is to create a court to play tennis in the East-West direction too. You ...
23
votes
30answers
4k views

Drink your morning coffee

Draw this Ascii coffee cup: o o o __________ / \__ | J | \ | A | | | V | | | A |__/ \__________/ Brownie points for coffee-script or java :) ...
173
votes
339answers
56k 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 ...
20
votes
42answers
4k views

The next colour

Challenge Consider the rainbow as seven colours, represented by strings as Red Orange Yellow Green Blue Indigo Violet. Your task is to create a program that ...
40
votes
22answers
2k views

Happy Bacon Day!

Today is Bacon Day which is probably why the name of the hat for participating today is "Mmmm Bacon". What better way to celebrate bacon day with fun filled 2d matrices made out of bacon! A 1 by 1 ...
-4
votes
13answers
630 views

Generate and print the first 20 Fibonacci numbers with the least unique characters [duplicate]

As the title suggests, my task is fairly straightforward: Write a program in your language of choice that will print out the first 20 Fibonacci numbers using the least unique characters. For example ...
28
votes
86answers
14k views

Print a Christmas Tree

The Challenge Print a nice Christmas tree with it's own star at the top using the shortest code possible. The tree star is an asterisk (*) and the tree body is ...
17
votes
6answers
2k views

Golf me an ASCII Alphabet

Don't you find that reading simple text isn't appealing enough? Try our ...
-2
votes
11answers
647 views

Map of India - minimum number of bytes

Your challenge is to make a program(less number of bytes than what the below program takes) that should print the map of India with any special character of choice. TIO Link ...
75
votes
12answers
5k 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: ...
10
votes
16answers
918 views

Print the last answerer's first submission

In this challenge, your past self comes back to help or hurt someone else! The task is simple: write a full program, not a function, that prints the first code submission on this site submitted by the ...
7
votes
13answers
1k 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 ...
26
votes
26answers
5k views

Print a list of iPhones

Write the shortest program that prints, in order, a complete list of iPhone iterations, according to this site: ...
60
votes
27answers
7k views

Golf Your Language's Identicon

Identicons are small images of geometric patterns that represent the hash value of a string. Stack Exchange uses the identicons from Gravatar as each user's default avatar image. In this challenge, we ...
71
votes
69answers
9k 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 ...
74
votes
23answers
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 ...
30
votes
28answers
7k views

Output a Super Mario Image

This is a problem on Luogu OJ. I decided to post it here because on Luogu OJ, many people, including me and my friend, are interested about how to solve this problem within the fewest characters. ...
94
votes
50answers
13k 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 ...
114
votes
47answers
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 ...
47
votes
60answers
3k views

Print the f × f times table

Your task is to print the hexidecimal times table: ...

1
2 3 4 5
13