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

0
votes
0answers
56 views

Generate Easy to remember PIN-codes [on hold]

My bank sends me one time transaction codes by SMS, which are six digits long. I must read them from my phone and type them on a computer. It struck me that most of the times, there is a rythm or ...
17
votes
3answers
2k views
+100

Enclose 1009 pixels

Output is a shape that encloses 1009 pixels. The shape must take the form of a single, closed, non-intersecting loop. Input is a positive non-zero integer. Each input must yield output that is ...
6
votes
3answers
322 views

Help me with trigonometry!

Thank you guys so much for your help with calculus. Now I need some help with my upcoming trigonometry test. On the test, I'll need to simplify expressions. I’ll be given input like 4sin(x)/(2cos(x)) ...
11
votes
8answers
501 views

Comment-free polyglot

Polyglots are programs that are valid in multiple programming languages simultaneously. Most such polyglots are written in such a way that certain constructs of one language are interpreted as ...
5
votes
4answers
548 views

Un-hash the Java Hash

Hash Un-hashing The basic goal of this challenge is to exploit the high probability of collision in the Java Hash function to create a list of plausible inputs that created an outputted hash. The ...
15
votes
5answers
632 views

Program a 2048 AI using an existing Framework [duplicate]

EDIT : Recently, my question has been proposed as a duplicate of 2048 Bot Challenge. I would like to stress that this question is different from that question, and will require answers to be ...
10
votes
4answers
830 views

5 Seconds to Find Pie

Pi times e (or Pie if you like ambiguous notation) to 100 decimal places is: 8.5397342226735670654635508695465744950348885357651149618796011301792286111573308075725638697104739439... (OIES A019609) ...
-1
votes
0answers
30 views

Can I propose a contest for my own “programming language”? [migrated]

I have a custom CPU emulator, with 44 instructions (opcodes), and I would like to challenge you guys to code a better kernel for it (current one is a simple command interpreter with 3 commands: HELP, ...
8
votes
1answer
384 views

Frogger Champion

The Game Most of us know about Frogger, the 80's era arcade game where the objective is to hop a frog safely across a busy highway and a hazard-filled pond to arrive safely at home. A challenge was ...
3
votes
2answers
395 views

Rolling digital number lock [duplicate]

There's a simple digital number lock. After each button press the lock checks if the previous four presses constitute the correct code. I.e. typing 44445 tests two codes: 4444 and 4445. You must brute ...
6
votes
7answers
1k views

The Bowlers-Golfers Fraction War

Introduction Let's start by arranging all fractions from 0 to 1 in order of lowest denominator, then lowest numerator: 1/2, 1/3, 2/3, 1/4, 3/4, 1/5, 2/5, 3/5, 4/5, 1/6, 5/6, 1/7... Note that ...
10
votes
3answers
455 views

Sort some apples!

Problem Imagine 7 buckets lined up in a row. Each bucket can contain at most 2 apples. There are 13 apples labeled 1 through 13. They are distributed among the 7 buckets. For example, {5,4}, {8,10}, ...
24
votes
5answers
2k views

Radioactive Quines

A radioactive quine is a quine-like program that has an even number of characters and, when run, outputs itself with exactly half of its characters removed. The output itself may be a radioactive ...
6
votes
0answers
237 views

Detect Duplicate Questions

Detect Duplicate Questions Once upon a time, there was a golfing site. It had a problem: people would post similar or identical questions again and again. You have been chosen selected forced ...
7
votes
3answers
876 views

Restricted memory optimization

The edit (or Levenshtein) distance between two strings is the minimal number of single character insertions, deletions and substitutions needed to transform one string into the other. If the two ...
-5
votes
2answers
128 views

SPCL (Society for the Prevention of Cruelty to Loopholes) [closed]

I am a founder member of the above society. Maybe that's why people keep telling me I'm special. I want to raise the profile of loopholes. I am looking for a program which exhibits as many ...
15
votes
10answers
1k views

How to slow down a drunkard on his way home

Consider a square n by n grid graph that looks like this. It is important to notice that this graph is 11 by 11. At any given point a man stands at an intersection and he only ever moves ...
12
votes
1answer
387 views

How long is your (language) snake?

Following on from the third order quine challenge, your task is to write an Ouroboros program that uses as many languages as possible. That is, in language A, write a program pA which outputs program ...
6
votes
4answers
1k views

Can you beat the optimizer?

This is an optimization/algorithms challenge. Given two sets of points X and Y, which are to be thought of as points on a circle of circumference T, the challenge is to find the rotation which ...
33
votes
23answers
6k views

Rosetta Stone Challenge: What's Average Anyways?

The goal of a Rosetta Stone Challenge is to write solutions in as many languages as possible. Show off your programming multilingualism! The Challenge When people use the term "average," they ...
-4
votes
0answers
49 views

Find if all brace pairs in an array of strings are correctly formatted [duplicate]

I created a fun challenge. I call this the BRACES Challenge. The rules are simple. Given an array of strings, find out if all brace pairs in each string are formatted correctly. braces: []{}() ...
44
votes
17answers
6k views

mastermind horse battery staple

Objective Given a list of three-word passphrases, crack them all. Each time you guess, you will be given a clue in the style of Mastermind, depicting how many characters match the password, and how ...
5
votes
3answers
800 views

Another Euler Brick in the Wall

A Euler Brick is a cuboid where the length of all the edges are integers and all of the diagonals of the faces are integers as well. All sides must also be different. Your program has to find as ...
21
votes
1answer
1k views

Domino Circuits

Scoreboard Here are the raw scores (i.e. domino counts) for VisualMelon's submission. I'll turn these into the normalised scores described below, when more answers come in. The existing solution can ...
16
votes
1answer
575 views

Horror Movie Search Party

Plot: Jimmy is missing; we have to find him. We should split up. Plot twist: Jimmy is already dead. But, our cast doesn't know that, so they need to search the whole area anyway. There is an N ...
5
votes
1answer
206 views

fit 22 (perhaps 23) of a specific 3d pentacube into a 5x5 cube

The original problem is stated here over at math.SE The task is writing a program that fits 22 copies (or perhaps 23) of the following pentacube into a 5x5x5 cube (back and front view). The ...
40
votes
6answers
1k views

ASCII Art Calendar

Let's make an ASCII art clock and calendar that tells us the current month, day of the month, day of the week, hour, minute, and whether it's night or day (but not the year or second). At any ...
7
votes
5answers
952 views

Find the craftiest prime

Intro Consider the process of taking some positive integer n in some base b and replacing each digit with its representation in the base of the digit to the right. If the digit to the right is a 0, ...
30
votes
14answers
7k views

Programming Dichotomies (Literally)

Consider a question written in plain English whose answer involves two reasonably accurate (but potentially clever) words or phrases that can be separated by the word 'and': Q: What are the two ...
12
votes
1answer
419 views

Fusing Fireworks

Overview Given a list of fireworks a-z and times 3-78, arrange them with fuses to make them all light up at the correct time. A line of input is given as space separated letters and numbers: a 3 b ...
59
votes
15answers
5k views

Implement the Game of Life on anything but a regular grid

Conway's Game of Life is (almost) always played on a regular square grid, but it doesn't need to be. Write a program that implements the standard cell neighboring rules from Conway's Game of Life on ...
37
votes
12answers
6k views

What's the shortest contiguous subset of ASCII you need to output the rest?

The printable ASCII characters (hex codes 20 to 7E) in order are: !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ (Note that space is in ...
7
votes
1answer
197 views

Minimal cover of bases for quadratic residue testing of squareness

Challenge Find the smallest cover of bases (e.g., moduli) whose sets of quadratic residue can be tested via table-lookup to definitively determine whether or not a given non-negative integer n is a ...
2
votes
6answers
323 views

sort and restore a set of bytes in optimal form

Challenge For any given input Y of length >= 1024 bytes: sort in ascending or descending order -- your choice generate output Q, where Q = [sorted data] + [restore information] restore Y using Q as ...
14
votes
3answers
533 views

Find the shortest bracket numbers

Bracket numbers provide a simple way to express large integers using only left bracket, space, and right bracket ([ ]). A bracket number is defined as a string of one or more pairs of matching ...
-1
votes
2answers
271 views

Find prime which is generating longest primes sequence using p(n+1)=(p(n)^2+1)/2

Consider following recurrence relation: p[n + 1] = (p[n]^2 + 1) / 2 If p[1], p[2], ..., p[k] are primes and p[k+1] is not, then k is length of sequence starting with p[1]. For example, if p[1] = 3, ...
27
votes
10answers
4k views

Find the largest prime whose length, sum and product is prime

The number 113 is the first prime whose length 3 is prime, digital sum 5 = 1 + 1 + 3 is prime, and digital product 3 = 1 * 1 * 3 is prime. A prime that has these 3 properties will be called supremely ...
23
votes
3answers
972 views

Where are the runs in this infinite string? (CCCCCC Found!)

Starting with the string ABC, consider the result of repeatedly appending the last half of itself to itself (using the larger half if the length is odd). We get the progression: ABC ABCBC ABCBCCBC ...
18
votes
13answers
1k views

Khinchin's constant to as many decimal places as possible in 64 bytes or less

Khinchin's constant is a curious mathematical constant that, according to Wolfram MathWold, is "notoriously difficult to calculate to high precision". Here it is to 100 digits: ...
0
votes
2answers
402 views

Conway's Game of Life with smallest *set* of source characters [duplicate]

The goal of this challenge is to write a program that will simulate a single round of Conway's Game of Life on an existing grid. Input format: Input will be read from stdin. The input will consist ...
14
votes
2answers
523 views

Maximum number of PEP8 violations in a single line

Your task is to write a file which contains a line with many pep8 violations. The rules: We use pep8 version 1.5.7 and the default settings. Calling pep8 with other command line options or ...
3
votes
1answer
309 views

Make a Number Expression

Few years ago, an esoteric programming language named 아희(Aheui) was created. Well, actually you don't need to know about this language or Korean characters. Aheui uses stacks and a queue, but this ...
19
votes
2answers
1k views

Optimize paper folding to mitigate inkblots

Dark black ink has splattered all over your white sheet of printer paper! The obvious solution is to fold the paper so black and white parts meet and both become grey as the ink diffuses. Then unfold ...
3
votes
1answer
1k views

Optimal Minesweeper on the Largest Board

Overview: Your challenge is to write a program that will play minesweeper optimally, giving the best move in any position. Moreover, you must do this on the largest board possible. Game details: ...
0
votes
1answer
365 views

Babylon.js - loop through a scene and apply a simple fragment shader to all of the objects

You have a library - a fully loaded 2014 Babylon.js. You have a fragment shader - let's call it sample.fragment.fx. You have a scene - loaded ahead of time, possibly from a .babylon JSON file. Your ...
10
votes
3answers
451 views

mathpack numeric literals

preface In a very heated situation you have to go even further with golfing. (e.g. in a challenge where your answer is 100 characters long and it is just embarrassing that you couldn't make it 99) ...
1
vote
4answers
671 views

Rotate 2D Array [duplicate]

Given an input of a 2 dimensional array of integers, rotate the array 90 degrees clockwise. It should work for rectangular arrays of all sizes and proportions. The rotated array should be printed at ...
0
votes
1answer
425 views

Racketeer Taxi Driver

The Scenario You are a taxi driver in your city. You picked up a passenger from the airport and he told you the place he'd like to go. To earn more money, you need to drive as much as you can. ...
29
votes
6answers
3k views

To Vectory! – The Vector Racing Grand Prix

Vector racing is an addictive game that can be played with a pen and a sheet of square-ruled paper. You draw an arbitrary racetrack on the paper, define a start and end and then you steer your ...
3
votes
2answers
384 views

Deplane! Deplane! (Or: RGBRGBRGB => RRRGGGBBB?)

Imagine bytes in memory for an RGB image--R and G and B represented by bytes in sequence. If an image is NxM then the memory layout will be M repetitions for vertical scanlines of 3*N bytes in ...