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.
9
votes
4answers
232 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 | ...
7
votes
16answers
1k views
Display “Happy Easter!”
Your task is to print the following:
_ _ _______ _
| | | | (_______) _ | |
| |__ | | ____ ...
-4
votes
0answers
83 views
Code Golf: Open the book! [duplicate]
Write a program or function that takes in a positive integer.
If the integer is even, print
_.-'\
_.-' \
,-' \
( \ \
\ \ \
\ \ \
\ \ ...
16
votes
2answers
827 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 ...
5
votes
16answers
347 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
251 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
121 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 ...
12
votes
3answers
396 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 ...
3
votes
5answers
387 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 ...
15
votes
5answers
736 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
1k 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 ...
18
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
681 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 ...
49
votes
9answers
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
161 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
176 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 ...
6
votes
6answers
438 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
145 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 ...
7
votes
2answers
117 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 ...
14
votes
6answers
742 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
647 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 ...
3
votes
7answers
439 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 ...
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
...
28
votes
47answers
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
184 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
353 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:
...
11
votes
12answers
2k views
Eeny, meeny, miny, moe
Introduction
The childhood song Eeny, meeny, miny, moe was often used to select who was "it" when playing tag. Everyone would stand in a circle and point at one person selected at random. They ...
5
votes
1answer
114 views
Encode bytes to PGP wordlist format
The PGP Word List is a set of 512 English words for verbally communicating strings of bytes, such as authentication codes or hashes. It is used in secure VoIP software as well as in some other ...
5
votes
2answers
176 views
Build an English word syllable counter
Write a program or function to estimate as closely as possible the number of syllables in English words.
The input list is here: 1000 basic English words. There are only 997 words because a few ...
22
votes
13answers
2k views
Create an ASCII-to-hex table for Mark Watney
Inspired by this SciFi.SE question.
Background (with minor spoiler):
Challenge
With no input, output the following ASCII table exactly like this:
Dec Hex Dec Hex Dec Hex Dec Hex Dec ...
8
votes
15answers
447 views
Chinese Zodiac of the year
2015 was the year of the goat! In this challenge, you will figure out which animal represents the year. To avoid making this challenge to complex you won't need to calculate Chinese new year.
Because ...
5
votes
6answers
226 views
Using Symbols for Letters
Input: A single word as a string (matches [a-zA-Z]+). If the input doesn't follow these guidelines, print "Error" (but no error should be thrown)
Output: The NATO pronunciation of the word. Print ...
25
votes
6answers
392 views
What song is playing?
Inspired by this xkcd
You work for Shazam and they have a project for you. Some customers are complaining about their app taking up too much space on their phone, so they want you to code a lite ...
1
vote
0answers
51 views
Merry Christmas (and a Happy New Year) [duplicate]
The goal of this challenge is to create a program that outputs a string depending on the time of year.
Output
If the date is December 25, output:
Merry Christmas!
If the date is December 31 or ...
42
votes
12answers
5k views
Help Trump build the wall!
Trump needs the wall constructed and you are going to do it! To most efficiently build his wall I have created a simple, repeatable pattern for you to use:
__ __
| |_| |
___| ...
16
votes
2answers
316 views
Forgotten Realms date calculator
In an effort to level the playing field between languages with built-in date libraries and those without, let's work with a fictional calendar. The Forgotten Realms are a (the?) campaign setting for ...
23
votes
16answers
1k views
A multiplication table for the Cheela
The Cheela (from the book Dragon's Egg by Robert L. Forward) are creatures that live on the surface of a neutron star. Their body is flat and circular with twelve eyes on the perimeter, so they ...
29
votes
6answers
1k views
Unfolding the Hexagony source code
Introduction
If you're not familiar with Hexagony, it's an esoteric language created by Martin Büttner. The thing is that this language accepts multiple forms for the program. The following programs ...
18
votes
5answers
354 views
8-bit Chess Pixel Counting
Goal
You're playing a computerised chess game. The display is in black and white only and the pixels are chunky. White pixels use a lot power compared to black pixels and you're concerned about ...
23
votes
8answers
515 views
The alphanumeric spiral
The task is very simple, when given an input, output one of the following spirals:
Input = 1 gives a spiral with the letter A beginning in the top left corner:
A B C D E F
T U V W X G
S 5 6 7 Y H
R ...
22
votes
9answers
1k views
Basic Latin character name to character
Let's get back to basics!
Your code, a complete program or function, must convert the official Unicode name of a printable Basic Latin character into the corresponding character. For example, for ...
15
votes
5answers
309 views
Can't see the forest for the keys
Write a program or function that takes in a nonempty list of integers in any reasonable convenient format such as 4, 0, -1, -6, 2 or [4 0 -1 -6 2].
Print or return a string that depicts the list as ...
5
votes
5answers
365 views
Find that zipcode!
Italian zipcodes are 5-digit numbers. Each number is linked to a province. There are 4610 zipcodes and 110 provinces (as of 2015) in Italy.
Given the list of zipcodes and the related province (in ...
0
votes
3answers
142 views
Guess my password! (Code Golf) [duplicate]
So, like the title says, today you are going to guess my password (sort of). You need to make a big long list of every possible password I might be using on my 4 digit online vault.
Specifications:
...
18
votes
17answers
2k views
States and Capitals
Given a string as input, output the US state whose capital it is if it is a state capital, the capital of the state if it is a state, or Arstotzka if it is neither.
Examples:
Austin -> Texas
...
47
votes
89answers
8k views
“99 Bottles of Beer”
Write a program that outputs the lyrics to 99 Bottles of Beer, in as few bytes as possible.
Lyrics:
99 bottles of beer on the wall, 99 bottles of beer.
Take one down and pass it around, 98 bottles ...