a challenge to build objects (e.g. code, representation of real world objects) according to pre-defined rules and/or input (also often randomised).

learn more… | top users | synonyms

18
votes
15answers
2k views

Generate a random program in your favorite language

We all heard of testing compilers using randomly generated inputs. Your task is to write a program to generate a valid program (including no undefined behavior) in your favorite language. The ...
8
votes
2answers
570 views

Compile Regexes

In this task you have to write a program that reads a regular expression and generates another program that outputs whether an input string is accepted by that regular expression. The output must be a ...
7
votes
4answers
701 views

Encode a program with the fewest distinct characters possible,

The goal is to write a program that encodes an other program (input) with the fewest character possible. Scoring The score is equal to the different number of characters needed for the output. ...
49
votes
34answers
10k views

Avoid the evil integers!

You are developing some code to generate ID numbers. Policy requires that no ID numbers include the digit sequence 666. Create a function (or your language's equivalent) which takes a positive ...
18
votes
69answers
8k views

How to write a single-line password generator [closed]

Is there a way of writing a password generator in only one line? The password should consist of 8 random chars out of a-z, A-Z and 0-9. It should also return a different password every-time. Also, ...
18
votes
2answers
1k views

Mastermind strategy

I could only find code-golf challenges for Mastermind, so here's a code-challenge version that I would have liked to take on myself. An optimal strategy for the normal Mastermind game, MM(4,6), was ...
8
votes
14answers
765 views

Generate a grid of sums

Challenge Generate a 7 by 7 grid, filled with random numbers. However, every other row and column, you must use the sum of the surrounding cells. Here's a small example with a 3 by 3 grid: 2 2 2 2 ...
4
votes
0answers
350 views

Generate Loopy puzzles

Loopy is a puzzle game from the collection of Simon Tatham. The previous link contains a javascript implementation of a Loopy puzzle generator. I suggest everybody who wants to attempt this challenge ...