A code challenge is a competition for creative ways to solve a programming puzzle with an objective winning criterion not covered by other scoring tags (e.g. code-golf).

learn more… | top users | synonyms

3
votes
2answers
143 views

Building a long chain of words

This challenge is to find the longest chain of English words where the first 3 characters of the next word match the last 3 characters of the last word. You will use an common dictionary available in ...
2
votes
0answers
107 views

Cell-phone golf

Older cellphones have 3 or 4 characters mapped to each number from 2-9 and that number must be pressed a certain number of times to get the required character. Let's assume our cellphone has this map: ...
9
votes
5answers
304 views

Put the line in the code you nut and shake it all up

Using one programming language write 5 single-line programs, each of which outputs a different line of the first verse to Harry Nilsson's 1972 song "Coconut" when run individually: Brother bought ...
0
votes
4answers
323 views

All those duplicate questions deserve duplicate code to show them off

All those questions that are duplicates... Ignored and marginalized by society. It is just not... right. We have to do something. There surely must be love for them too. They feel appreciated if a ...
81
votes
18answers
7k views

Lab Rat Race: an exercise in genetic algorithms

This is Fortnightly Challenge #3. Theme: Genetic Algorithms This challenge is a bit of an experiment. We wanted to see what we could do, challenge-wise, with genetic algorithms. Not everything may be ...
24
votes
3answers
951 views

Looking for programs in a huge Boggle board

Each character in this 64 by 64 block of text has been chosen randomly and uniformly from the 95 printable ASCII characters. /rq$:Zy5*g'$DeGXX2o8y "{@Cg:FR9qih}xh >5$DsF1Fs5Ao~smFp;.RJbV )U ...
6
votes
1answer
203 views

Combinator quines

Background You have just learned what combinatory logic is. Intrigued by the various combinators you spend quite a bit of time learning about them. You finally stumble upon this particular ...
5
votes
0answers
189 views

Delivery Robots and Destroyer Drones

Program your robots to deliver packages in a warehouse infested with destroyer drones. Avoid the drones and get your packages to the right place as fast as you can. Delivery Robots There are ...
13
votes
2answers
646 views

Go and make it starry

In this contest you have to write a program, that accepts a black and white pixel image, and tries to alter it, such that the white shape forms star domain, with as few changes as possible. Allowed ...
6
votes
3answers
374 views

Retrograde morse (d)e(n)coder

This question is inspired by retrograde music. Retrograde music is a piece of music that can both be played normally (from the beginning to the end) as reversed (from the end the beginning). A similar ...
12
votes
1answer
249 views

Robot roadie needed to pack the truck

As the band's roadie, you have to pack the truck. Your program will place the packages so that they fit in the smallest height. A badly packed truck Rules Packages may be rotated through ...
12
votes
0answers
264 views

Build a fewest-moves freecell solver

In the game of Freecell, you are tasked with building four foundation piles in suit from ace to king, on a layout where you build downward in alternating colours. However, you can only build one card ...
26
votes
3answers
636 views

Image Battle of Colours

NEW: 100 REP OFFER: TheBestOne has offered 100 reputation to the author of an answer that can beat his Swallower program. Write a program to colour as much of an image as possible before opposition ...
17
votes
4answers
971 views

Draw A Snowflake

Joe lives at the Bahamas. It is winter. His children are disappointed that there is no snow. Joe needs to make snow for his children. Fortunately, he has a 3-d printer. He plans to make snowflakes ...
13
votes
3answers
1k views

Computer: you do the math

This challenge is partly an algorithms challenge, involves some math and is partly simply a fastest code challenge. For some positive integer n, consider a uniformly random string of 1s and 0s of ...
5
votes
2answers
687 views

Coding a recursive function for highest possible input

Challenge You are given the following function:- which is the same as:- with the base cases q(r, b, L) = 1 whenever r ≤ L, q(r, 0, L) = 0, if r > L and q(r, 0, L) = 1, if r ≤ L. Your task is to ...
29
votes
9answers
3k views

Program a Racing Car

CONGRATULATIONS to @kuroineko. Wins the bounty for excellent speed (672 moves) on the Gauntlet track. LEADER:* Nimi scoring a lightweight 2129. Other entries are larger but showing some serious ...
14
votes
3answers
1k views

Distinguish between Masculine and Feminine Nouns in French within 100 characters

You are to write a very small program within 100 characters. Your program must distinguish between masculine and feminine french nouns. The output should be un if it is masculine and une if it is ...
7
votes
2answers
584 views

Divide food to the poor equally!

The problem Through a terrible procastination accident you are reborn as Scrooge McDuck for a day. To make the most out of the situation you decide to give away food to the poor. Since you also are a ...
8
votes
5answers
610 views

Smallest Bytecode Interpreter/VM

Leaderboard - JIT Compiled (Lower is better) es1024 - 81.2 points (including a working compiler!) Kieth Randall - 116 points Ell - 121 points Leaderboard - Interpreted (Lower is ...
11
votes
5answers
384 views

Generalized Gematria Calculator

Create a bidirectional Gematria calculator, for any given sequence of Unicode characters as the alphabet. Gematri-What? Gematria is a system of assigning numerical values to symbols, developed by ...
28
votes
12answers
3k views

Say Hello to the Pioneers of Computer Science

Choose your favorite famous computer scientist or computer science pioneer who was born in 1942 or earlier (as 1943 marks the start of the creation of the 'first' computer). They should have a ...
21
votes
6answers
2k views

Find the largest fragile prime

Consider the function Remove(n, startIndex, count) that removes count digits from the number n starting from the digit at position startIndex. Examples: Remove(1234, 1, 1) = 234 Remove(123456, 2, 3) ...
7
votes
1answer
387 views

Digesting Polygons

Digesting a polygon is a process in which you take an input polygon, and create another polygon that can contain the entirety of the input polygon, while having one side less than it. The goal of ...
28
votes
14answers
3k views

Sudoku Compression

Your job is to write a program (or two separate programs) in any language that: Can take a completed Sudoku board as input (in any logical format) and compress it into a string of characters Can ...
10
votes
4answers
691 views

Tiling, given vertex configuration

Task The task is to tile polygons, given a vertex configuration. Scoring Your score is equal to the "complexity level" your submission reaches. Complexity levels are cumulative, meaning that to ...
44
votes
6answers
4k views

Let's Judge Some Books By Their Covers

Everyone knows that the content makes the question. But a good title helps too, and that's the first thing we see. It's time to turn that first impression into a program, and figure out what kinds of ...
5
votes
0answers
236 views

Tic-Tac-Toe and Chess, with fewest [distinct] characteers

In this form of the game Tic-Tac-Chec, the goal is to move chess pieces to get four-in-a-row. Your goal here is to figure out if a position has a winning move. Rules The rules are similar, but not ...
19
votes
4answers
2k views

The Fatal Error Challenge

Objective Write a routine that accepts a string of printable ASCII characters, s, and returns a string containing the same characters as s, reordered so that no two-character substring appears more ...
10
votes
3answers
1k views

Find highest scoring matrix without property X

This challenge is partly an algorithms challenge, partly an optimization challenge and partly simply a fastest code challenge. A cyclic matrix is fully specified by its first row r. The remaining ...
61
votes
9answers
5k views

Counting Grains of Rice

Consider these 10 images of various amounts of uncooked grains of white rice. THESE ARE ONLY THUMBNAILS. Click an image to view it at full size. A: B: C: D: E: F: G: H: I: J: Grain ...
12
votes
5answers
678 views

RadioASCII Elements: Output the elements of the periodic table while slowly losing characters

Here is a list of the 118 (current) elements of the periodic table (in a collapsed Stack Snippet for your convenience): Hydrogen Helium Lithium Beryllium Boron Carbon Nitrogen Oxygen ...
21
votes
5answers
1k views

Sort a List With Swaps and Pops

Consider a randomized list of the integers 1 to N. You want to sort it using only the following actions: Swap the first and last list elements. (S) Pop off the first element and append it to the end ...
10
votes
2answers
776 views

Are You the One? (Mastermind Derivative)

I've got a tough one for you! My girlfriend recently came across a new show on MTV (USA). It's a terrible show, and everyone on it is trashy, but the "game" is pretty interesting. From Wikipedia: ...
3
votes
8answers
562 views

Leave your mark!

In this challenge, you'll need to edit a grid of characters to make a program that does a task, while ensuring that you leave a lasting mark on the grid. Task The task to perform is determined by ...
12
votes
3answers
2k views

Onion Programming

Using only printable ASCII (hex codes 20 to 7E), write a square N×N core program without comments that is surrounded by 4 more layers, creating a (N+8)×(N+8) square program (N > 0). For N = 3 the ...
66
votes
88answers
12k views

ASCII's 95 Characters…95 Movie Quotes

Update: The winner has been decided, but the challenge is not over! Finally, nearly 3 months after the question first started, someone has remained the last answerer for more than a week! ...
3
votes
2answers
409 views

The Mirror Maze Mania

Puzzle There are some mirrors located throughout a grid. A ray of light enters the grid from some position. It travels through the grid in a straight line trying to escape. On encountering with a ...
5
votes
1answer
357 views

Make your country proud!

You are from the tiny country of Que-Wopistan. The Que-Wopistonion's are a proud people, and every Que-Wopistonian dreams of making their country proud by representing their country in the Olympics. ...
5
votes
1answer
328 views

Invent your own Unicode 7.0.0 encoding (as efficient as possible)

As you may know, the Unicode standard has room for 1,114,111 code points, and each assigned code point represents a glyph (character, emoji, etc.). Most code points are not yet assigned. Current ...
14
votes
3answers
740 views

Choose-Your-Own-Language Code

Let's take a grid of 16x16 printable ASCII characters (code points 0x20 to 0x7E). There are 30-choose-15 paths from the top left to the bottom right corner, making only orthogonal moves, like the ...
3
votes
0answers
178 views

Crafting Canonically Cöcher Crosswords

The Setup Most of us are familiar with crossword numbering, which follows three basic rules: in a character grid consisting of blacks and whites (see below), any maximal contiguous horizontal or ...
164
votes
168answers
24k views

Evolution of “Hello World!” (testing new type of challenge)

Update: I'm officially announcing that this contest is over since it (and I) have been inactive for well over a month. Thanks to everyone who participated and especially those of you who helped ...
21
votes
10answers
1k views

Short Deadfish Numbers

Deadfish is one of the best known non Turing-complete programming languages. It has only one accumulator (which starts at 0) to store data, and only four commands: i - Increment the accumulator s - ...
19
votes
4answers
1k views

Hungry Image Snake - Hole #3

Hole #1 Joe the snake is hungry. He eats pictures, one pixel at a time. He really likes bright pixels. The Challenge Program Joe to eat the most bright pixels he can find, given that he can only ...
13
votes
3answers
999 views

Write a square program that outputs the number of times it has been “unrolled”

Consider a square block of text, N characters wide by N tall, for some odd integer N greater than 1. As an example let N = 5 and the text be: MLKJI NWVUH OXYTG PQRSF ABCDE Notice that this is the ...
36
votes
13answers
4k views

Programming with a Sporadic Shift Key

There's something wrong with your keyboard. The Shift key has a mind of its own. Every time you type a character you have no idea whether it will come out shifted or not (though it is 50-50). Besides ...
6
votes
2answers
397 views

Turn nouns into plurals

Your task is to take as input an English noun and output its plural. To win the challenge you must trade off code length against accuracy. Entries will be scored according to this comma-separated ...
25
votes
6answers
2k views

Swipe Type Converter

The next revolution in typing on laptops was released on the first of April, 2014 by SwiftKey. However, I want to be the first person to write a swiping nano clone, but, as I can't find a good ...
7
votes
2answers
203 views

Stabilize a Brick Structure

Bricks and Stability Defined This question uses the same definition of bricks and stability as Is the brick structure stable? Let [__] represent a masonry brick and . . ...