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 existing challenges.

learn more… | top users | synonyms

1
vote
0answers
106 views

Brute force my code lock [duplicate]

The code lock for my garage has 5 buttons, labeled "1 2", "3 4", "5 6", "7 8", and "9 0". To open the garage door, you have to enter the correct 4-digit PIN. As you can see, every button represents ...
16
votes
14answers
550 views

Output a Magical 8 Trapezium

Your task is to output a Magical 8 Trapezium: 1 × 8 + 1 = 9 12 × 8 + 2 = 98 123 × 8 + 3 = 987 1234 × 8 + 4 = 9876 12345 × 8 + 5 = 98765 123456 × 8 + 6 = 987654 ...
19
votes
95answers
5k views

Print Numbers from 1 to 10 [duplicate]

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 the Standard Output Your output format ...
41
votes
24answers
4k views

Polar Bear, Polar Bear, what do you hear?

The text of the children's book Polar Bear, Polar Bear, What Do You Hear? has a very simple pattern. You might use the text to teach introductory programming concepts. My son was quickly bored by ...
30
votes
70answers
3k views

Print all alphanumeric characters plus underscore

Write a program or function that prints or returns a string of the alphanumeric characters plus underscore, in any order. To be precise, the following characters need to be output, and no more: ...
2
votes
30answers
746 views

Print the ASCII printable character set [duplicate]

Challenge: Print the entire printable ASCII charset (not just a range!) in order. [space]!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ (Of ...
3
votes
7answers
319 views

Use 16 colors while writing Hey! 4 times

i.e each byte appears in a different ANSI shell colour. Rules Resetting the color of the shell after output is not required Must be output in STDOUT or the primary colour text output of your ...
28
votes
11answers
3k views

Visualise Bit Weaving

The esoteric programming language evil has an interesting operation on byte values which it calls "weaving". It is essentially a permutation of the eight bits of the byte (it doesn't matter which end ...
7
votes
2answers
475 views

All Armstrong numbers

An Armstrong number (AKA Plus Perfect number, or narcissistic number) is a number which is equal to its sum of n-th power of the digits, where n is the number of digits of the number. For example, ...
10
votes
5answers
484 views

Send a cosmic call

The cosmic call is a message sent into space in 1999 and 2003. It's made of 23 127*127px monochrome bitmap images, as detailed here. Your mission is to write a program that displays the entire 127*...
2
votes
9answers
539 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 punctuation and the first letter's ...
5
votes
7answers
319 views

Ain't there nothing up my sleeves

Note: reference to Nothing up my sleeve number. Your task is to take no input and generate this exact output: d76aa478 e8c7b756 242070db c1bdceee f57c0faf 4787c62a a8304613 fd469501 698098d8 ...
12
votes
5answers
320 views

Display a cribbage score in ASCII

Cribbage is an interesting game, because you need a specific board to score your game. A cribbage board looks like this: Notice how the first column is on the left as it goes up, then on the right ...
20
votes
28answers
3k views

24 and 12 Hour Times

Write a program or function with no input that prints or returns this string of 24-hour and 12-hour times: 00:00 12:00am 01:00 1:00am 02:00 2:00am 03:00 3:00am 04:00 4:00am 05:00 5:00am 06:00 6:...
0
votes
0answers
74 views

Create a 3d-like ASCII art [duplicate]

Your challenge is to convert a string to an ASCII art version of it. Input Your input is a single string, wich you should convert into the ASCII art version of it. Output Your output should be ...
3
votes
2answers
322 views

Golf me an ASCII Alphabet

Don't you find that reading simple text isn't appealing enough? Try our ##### ### ### ##### ##### ##### ##### # # ##### # # # # # # # # # # # # # #...
16
votes
4answers
583 views

Correct way to add numbers to get lots of 8's

Inspired by this question which was further inspired by this one, write a program which takes two integers and adds them in a unique way, by performing an OR operation on the segments used to display ...
11
votes
5answers
310 views

Print the AdamN tile

Adam7 is an interlacing algorithm for raster images, such as PNG. It is called the "Adam7" algorithm because it was invented by Adam M. Costello, and it is generated by following a certain pattern 7 ...
1
vote
4answers
346 views

Kolmogorov complexity Chad Gadya [duplicate]

EDIT It is not clear how answers to the question of compressing a long text, without cumulative properties are relevant to golfing a short cumulative strong, any more than general Lempel Ziv ...
42
votes
9answers
5k views

Build a triangle without any triangles

As a little kid, I liked to play with these toys a lot: They probably intended for these to be used for art, but I always used them for math! Fractals, patterns, etc. One time, I was given this ...
8
votes
3answers
516 views

420 <s>Blaze</s> Golf It

This is a pretty simple challenge, but (I hope) a fun one. Task If right now either the month is 4 and the day is 20, the hour (on a 12 hour clock) is 4 and the minute is 20, or the minute is 4 and ...
10
votes
4answers
443 views

Code a code page

Introduction A code page maps integer values to a specific character. We can visualize a code page like this: +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+ | | 0 | 1 | 2 | ...
6
votes
23answers
2k views

Display “Happy Easter!”

Your task is to print the following: _ _ _______ _ | | | | (_______) _ | | | |__ | | ____ ...
17
votes
2answers
956 views

Fun with flags!

Write a full program with a source code of 256 bytes or less that looks at an image of a flag and determines what country that flag is from. A zip file containing the 196 different flags in the ...
6
votes
16answers
385 views

Draw an ASCII art phone keypad

Draw the following in the fewest bytes possible: ------------------------- | | ABC | DEF | | 1 | 2 | 3 | ------------------------- | GHI | JKL | MNO | | 4 | 5 | ...
9
votes
1answer
269 views

Golf English – using contractions

I have not laughed as much from Stack Exchange content as I have from this. I think you all will enjoy this challenge, as it is inspired by what is over there. You will write a function or program ...
8
votes
2answers
128 views

Generate E-series of preferred numbers

Resistors and other electronic components are typically manufactured with values that conform to one of the E-series of preferred numbers. IEC 60063 defines the following E-series: E6: 10 15 ...
13
votes
3answers
442 views

How many sides does this polygon have?

So in 1st grade math, you learn the names of polygons. Three sides is a triangle, 4 is a square, and 5 is a pentagon. However, in 1st grade honors, you go a bit further. Your challenge There is a ...
4
votes
5answers
393 views

Electoral votes from state name

Given a the name of a state of the United States as a string (with case), return the number of votes the state has in the Electoral College. Write a full program or function, and take input and output ...
16
votes
5answers
763 views

Is this number random?

I asked random.org for 128 random integers between 0 and 232 - 1. Since the random number generator was so eager to give the first 64 numbers first, they're obviously more random than the other 64. ...
21
votes
15answers
2k views

Code Golf Golf Score

It's Friday... so let's go golfing! Write code that determines the player's scoring on a hole in a game of golf. The code can be either a function or entire program. As the genre suggests, shortest ...
18
votes
5answers
2k views

How many characters are there on the icon of a Stack Exchange site?

Given the name of a Stack Exchange site which doesn't have their own design yet, decide how many ASCII characters (non-ASCII ones are counted separately) are there on their icons. Your code should ...
19
votes
8answers
1k views

Draw an ASCII house

This is a window: --- | | --- Let's add some walls |. Put two spaces on either side of it so that the window has plenty of room. | --- | | | | | | --- | Now let's add a roof and a ceiling. ...
26
votes
7answers
727 views

Surrounding Countries

Ever wonder what countries surround another? I do too, sometimes, and, well, here's the challenge for it. I have provided a list of countries and the countries that they touch that you must recognize ...
50
votes
10answers
3k views

Quack the Angry Duck

No one is quite certain what the emoticon >:U is intended to represent, but many scholars believe it looks like an angry duck. Let's assume that's the case. Task Given an integer n between 0 and ...
6
votes
1answer
176 views

It's the end, but the code-golf has been prepared for

Welcome to BBC Casting. We need a program that we can use to select a new actor to play The Doctor on Doctor Who. In the spirit of the show, your program will perform a regeneration from one actor's ...
31
votes
9answers
4k 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 ...
6
votes
3answers
190 views

LaTeX Table Generator

Write a function or program which, given a number of lines and columns, generates a corresponding tabular environment for LaTeX with no data in it. Table format and tabular Environment Here is an ...
7
votes
6answers
460 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 first line as input, and output the last ...
1
vote
1answer
148 views

Output the given English pronoun table

Output the provided table of English pronouns exactly, in as few bytes as possible. Code rules The code will take no input The table is tab-delimited Each line begins with a single tab \t if there ...
8
votes
2answers
130 views

Convert to ASCII Agrippa Numbers

Challenge Given a natural number, output it in the ASCII form of Agrippa's number system. Description I like odd alphabets and numeral systems. My favorite numeral system is one given by Heinrich ...
28
votes
27answers
3k views

Output all the white or black squares of a chessboard

Introduction This is how a chessboard looks like. You can see that a1 is a dark square. However, b1 is a light square. The Task The challenge is, given dark, light or both, output all the dark,...
14
votes
6answers
780 views

Output the current time in ascii art

Challenge Your task is to output the time (in 12 hour time) in ascii art. All characters that will be used are as follows: ___ __ ___ ____ _ _ _____ __ ______ / _ \ /_ | ...
10
votes
3answers
665 views

How many words of power did I shout?

In Skyrim, the player character can use powerful magic shouts (Thu'ums) to achieve their goals. Every shout consists of three words, however, the player can use the first one or two words to achieve ...
12
votes
11answers
2k views

Convert English to a number without built-ins or libraries

This challenge is similar to this other, however I made a restriction (see bold text below) that I think would made it much diffent and (I hope) fun either. The Challenge Write a program or a ...
4
votes
11answers
707 views

Print cos(2π/17) exactly

One way to construct a regular heptadecagon starts with drawing a horizontal line of length 1 from the center to a vertex. Then the distance along that line from the center to the second vertex is cos(...
11
votes
31answers
3k views

Go generate some Java

Your boss wants you to write code like this: public static boolean isPowerOfTen(long input) { return input == 1L || input == 10L || input == 100L || input == 1000L || input == 10000L |...
30
votes
51answers
4k views

Generate 100 Java Tuple classes

Write a script that writes to standard output, or your language's equivalent, 100 lines of (valid) Java code that begins with: class Tuple1 {public Object _0;} class Tuple2 {public Object _0,_1;} ...
9
votes
2answers
194 views

Output all valid classful public unicast IPv4 addresses

IPv4 addresses are 32 bits wide, and thus the size of the address space is 232, or 4,294,967,296. However, this is only a theoretical upper-bound. It is not an accurate representation of all the ...
12
votes
4answers
374 views

Strategies for representing a given large integer using arithmetic expression

I have a specific number in mind, but it's part of a challenge I'm doing, and I don't want people to do (all) the work for me. Here is a number which has the same digits, but shuffled: ...