# 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).

284 views

### Convert header levels to numbers

Introduction Nodes in tree structures (e.g. headings in a long document, law paragraphs, etc.) are often created by assigning a specific header level (h1, h2, etc.) to each item, but outputted with ...
111 views

### Sample win/loss data generator based on certain criteria

Lets say we have this existing data: Total - 10 Won - 7 Lost - 3 Longest Winning Streak - 5 Longest Losing Streak - 2 Now you need to write a function which generates an array of random ...
651 views

### Fill the rows, columns, and diagonals of an NxN grid with 1 through N

Task Given input N, generate and output an NxN grid where each row, column and the two diagonals contain the numbers 1 to N (or 0 to N−1 if that's easier). Input The input is a positive integer N. ...
3k views

### No strings (or numbers) attached

If you like this, you may also like Official Dyalog APL 2016 Year Game. Make 12 snippets/expressions, in the same language, that result in the numbers 0 through 10, and 42 respectively, but without ...
262 views

### Generate a Monotonic Function

Overview In this challenge, your task is to randomly generate a monotonic mathematical function between two sets. Input Your inputs are two positive integers s and n. After getting these inputs, ...
869 views

### Generate a Rectangle from a Specification

Introduction This challenge is inspired by Grime, my 2D pattern matching language. Basically, you are given a "grammar" that describes two-dimensional grids of characters, and your job is to generate ...
557 views

### Rubik's Cube Scrambles

Your task is to create a random sequence of moves, which can be used to scramble a Rubik's Cube. Such a scramble is made up of exactly 25 moves. Each move consist of of the letters UDRLFB optionally ...
145 views

### String generator based on a wildcard [duplicate]

Your task, if you accept it, is to make a string generator that generates strings based on a wildcard. You can make a function or a full program that receives 1 argument and sends to the standard ...
487 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 ...
4k 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 plates. ...
750 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 ...
2k 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 ...
215 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 ...
11k views

### Avoid the evil integers! [closed]

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 ...
1k 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 ...
1k 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 (...
660 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 ...
373 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 1234567890|12345|...
908 views

### Generate a grid of sums

Generate a 7 by 7 grid, filled with random numbers. However, in cells with an odd row and column number (starting at 0), you must use the sum of the surrounding cells. Here's a small example with a 3 ...
1k views

### Generate a right triangle

In this challenge, you must take two numbers (separated by a space) as input and output an ASCII right triangle, made up of xs. The first number will be the width and height of the triangle you ...
2k 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: ...
908 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. ...
769 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 ...
953 views

### Generate ASCII wilderness map [closed]

Generate an ASCII wilderness map. Example output: ................^^^^ ..................^^ ...^^^^........o.... .....^^^^........... .................... ........o....TT..... ..TTTT.............. ...
1k 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 ...
1k 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, ...
3k views

### Generate a random program in your favorite language [closed]

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 ...