Tagged Questions

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

10
votes
24answers
3k views

Generate me some appropriate license plates!

The scenario: You are a software designer working for a gov't-run company that designs license plates for cars and other vehicles. You've been asked to develop software that generates license ...
5
votes
7answers
620 views

Generate four type-4 GUIDs for me

The type 4 GUID is described by Wikipedia, quoth: Version 4 UUIDs use a scheme relying only on random numbers. This algorithm sets the version number (4 bits) as well as two reserved bits. All ...
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 ...
0
votes
3answers
193 views

Create a Question Asker! [closed]

Writing questions for programming puzzles is tiring and takes many minutes to do. This is where you come in. Your job is to write a program that randomly generates plausible-sounding (but not ...
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 ...
5
votes
6answers
571 views

Generate random PESEL number

From Wikipedia: PESEL is the national identification number used in Poland since 1979. It always has 11 digits, identifies just one person and cannot be changed to another one. It has ...
10
votes
17answers
940 views

Histogram generation

Write the shortest program that generates a histogram (a graphical representation of the distribution of data). Rules: Must generate a histogram based on the character length of the words ...
5
votes
12answers
602 views

Make a colorful table

For this challenge, you must accept input as a comma-separated list (columns) of a run (rows) of the first letters of any of the colors red, orange, yellow, green, blue, or purple, and output (to ...
6
votes
7answers
355 views

Generate information cards with titles

You must take input in the form of title|line1|line2|(...)|line[n] And output an information card. It's hard to explain how to make the card, so here's a quick example: Input ...
8
votes
14answers
734 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 ...
10
votes
10answers
887 views

Generate a right triangle

In this challenge, you must take two numbers (separated by a space) as input and output a right triangle. The first number will be the width of the triangle you should output. The second number will ...
6
votes
19answers
1k views

Generate a pronouncable word

The challenge is simple: generate a word. Specifications: Word must be pronouncable. This is defined as "alternating between a consonant and a vowel." A consonant is one of the following letters: ...
7
votes
4answers
686 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. ...
8
votes
2answers
549 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 ...
9
votes
6answers
684 views

Generate ASCII wilderness map

Generate an ASCII wilderness map. Example output: ................^^^^ ..................^^ ...^^^^........o.... .....^^^^........... .................... ........o....TT..... ..TTTT.............. ...
4
votes
1answer
789 views

Lorem Ipsum Random Code Generation

An IDE developer has hired you to write a program that generates (by printing to stdout) n lines of randomly generated code. They will use your program to create sample code for use in marketing their ...
10
votes
3answers
822 views

Create a multi-level 5x5x5 Labyrinth with only one solution

The aim of this challenge is to create the shortest code (in characters) that successfully do the following: Specifications: Must create a 5x5x5 labyrinth with exactly 1 possible solution (no more, ...
17
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
7answers
916 views

Find all number pairs that sum to 121212 [closed]

This problem is quite easy to do by brute force. In fact, it'll be reasonably fast to brute force as well. But where's the fun in that? The Problem Produce a list of all unique 5 digit number ...
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, ...