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
0
votes
5answers
85 views

Print om sign with pi

This time I will give you an easy challenge: Print the Om sign with \$\pi\$!(Sorry for many challenges with \$\pi\$) Here is the om sign drawn using pi numbers: ...
6
votes
6answers
334 views
79
votes
100answers
14k 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: ...
21
votes
14answers
3k views

A long long time ago, in a galaxy … right here

Task Given a positive integer return the geologic era and period it was that many million years ago. Input/output The input is a string or integer; the output is a string. Eras and periods are ...
24
votes
20answers
2k views

Logo Pack LAPACK

This is the logo for LAPACK, a widely used software library for numerical linear algebra. Your task is to print the logo (color and matrix brackets not required) as this exact string. Trailing ...
20
votes
23answers
1k views

Make me a blanket!

I want a blanket that looks like this. Each strip goes over, under, over, under. Can you print it? ...
27
votes
23answers
3k views

Print a tongue twister!

The goal of this challenge is to print the following tongue twister: ...
35
votes
17answers
6k views

Print the SARS-Cov-2 (COVID-19) genome

Background As you probably learned in biology class, DNA and RNA are composed of strands of nucleotides; each nucleotide consists of a chemical called a base together with a sugar and a phosphate ...
442
votes
789answers
139k 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 ...
-7
votes
4answers
350 views

This ain't it Chief

This is mostly for the memes. I regret existing. Rules Your code has to output, by either printing or showing in stdout, the phrase This ain't it Chief. in that ...
21
votes
2answers
1k views

Get string “-” with JavaScript using only the symbols from “+[]”

Challenge: Get the JavaScript string value containing only the "-" character using code only containing the following three symbols: ...
92
votes
48answers
6k views

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 ...
76
votes
43answers
10k 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 ...
30
votes
27answers
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. ...
45
votes
87answers
11k views

Draw an ASCII chess board!

Here is a simple challenge for you: You must produce this ASCII representation of a chess board. White is represented by uppercase characters, and black is represented by lowercase. Empty tiles are ...
14
votes
9answers
4k views

Draw the Hilbert Curve

A Hilbert Curve is a type of space-filling curve, and it basically maps a line to a plane. Each point in the line corresponds to just one point in the plane, and each point in the plane corresponds to ...
25
votes
3answers
5k views

Print a Sorry Board

I was just playing the board game Sorry! with some people, and I realized that I could base a few interesting challenges off of it. This one is pretty simple. You task is simply to output an ascii-art ...
-4
votes
27answers
788 views

Print a square!

Print this text: _________ | | | | | | |_________| Shortest code wins. Notice the space at the start of the first line.
72
votes
24answers
3k views

Output the PPCG Prime

This is the PPCG Prime 624 digits long ...
14
votes
12answers
1k views

An Old Irish Blessing

I don't know who coined these words, and I'm not Irish, but I give you an Irish blessing: ...
13
votes
4answers
2k views

Archimedes's cattle problem

Compute, O friend, the number of the cattle of the sun which once grazed upon the plains of Sicily, divided according to color into four herds, one milk-white, one black, one dappled and one yellow. ...
72
votes
143answers
16k 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: ...
30
votes
22answers
14k 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 ...
122
votes
187answers
31k 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 ...
27
votes
73answers
3k 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 ...
29
votes
11answers
2k views

Implement Entombed's lookup table

Background Entombed is an Atari 2600 game released in 1982, with the goal of navigating through a continuous mirrored maze as it scrolls upwards. In recent times, the game has been subject to research ...
154
votes
280answers
45k 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 ...
1
vote
12answers
905 views

HyperNeutrino is back!

Today, @HyperNeutrino succeeded merging his two accounts, and finally got the reputation he lost back. Now, it's time to celebrate! Your task is to output this exact text: /\ ...
7
votes
5answers
291 views

Print the Black Mirror episode title

Given two integers, s and e, print the title of Black Mirror series #s episode #e. Expected output is as below, case sensitive. Output for blank cells and invalid inputs is unspecified. ...
28
votes
88answers
4k views

Generate alphabet with 4 copies of each letter

Note that this is not the same as Print the alphabet four times. This task is to write a program to generate four copies of each letter of the English alphabet, one letter per line, on standard ...
57
votes
11answers
4k 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. ...
5
votes
3answers
579 views

Solve the Rook's Round Trip

The riddle In yesterday's newspaper, I found a puzzle in which a Rook should start in the lower-left corner of a 12x12 checkerboard and then, during a round trip, visit each field exactly once except ...
-5
votes
2answers
260 views

Output NC_045512, the first sequenced genome of SARS-CoV-2 (COVID-19) [closed]

Output the variant NC_045512 of SARS-CoV-2. The genome's raw form is available here. Lowercase and uppercase are both acceptable You must output with the letters A, C, T, and G. An arbitrary number ...
-4
votes
11answers
318 views

Produce the string “deno” from the string “node” [closed]

The string "node" must be hard-coded in plain ascii to obtain a string with the value "node", which must be transformed into the string "deno". You cannot include "deno", any other variations, any ...
87
votes
280answers
23k 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 learned when I started learning programming ~10 years ago. Task You are to print this ...
44
votes
73answers
13k views

Hack into a Lottery

You've recently made an account on a dodgy gambling site, where for a fee of 25 dollars, they will pay you back a random amount between 0 and 50 dollars. After getting around 5 dollars twice, you ...
78
votes
151answers
17k views

“99 Bottles of Beer”

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

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. ...
22
votes
9answers
3k 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 regret ...
62
votes
161answers
15k 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 ...
59
votes
51answers
13k views

Display the Hacker Logo

You may have heard of the "Hacker Logo", also called the "Hacker Emblem". It looks like this: This is a pattern from a mathematical simulation called the Game of Life. The glider is the simplest Life ...
20
votes
12answers
1k views

Carpet an Airport

In 2015 the Portland International Airport began the replacement of their iconic carpet. I want you to write a program to draw their old carpet in as few bytes as possible. The carpet: ...
32
votes
16answers
3k views
39
votes
44answers
7k views

Kolmogorov shifter

Output or display the following three lines of text, exactly as they are shown below. A trailing newline is accepted. ...
23
votes
26answers
3k 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 ...
28
votes
51answers
3k views

Backwards Alphabet Triangle

Without taking any input, output this exact text: ...
44
votes
133answers
14k 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 ...
258
votes
63answers
71k 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:...
51
votes
21answers
6k views

Abbreviate that US state!

Given one of the 50 U.S. state names on the left as input, output its two-letter postal code as shown to the right: ...
8
votes
9answers
651 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 ...

1
2 3 4 5
12