Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [generation]

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

Filter by
Sorted by
Tagged with
12
votes
6answers
2k 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. ...
62
votes
47answers
6k views

N-dimensional N^N array filled with N

In: Enough memory and a positive integer N Out: N-dimensional N^N array filled with N, where N^N means N terms of N-by-N-by-N-by... Examples: 1: [1] ...
17
votes
2answers
960 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 ...
70
votes
76answers
6k views

No strings (or numbers) attached

If you like this, consider participating in: The Official Dyalog APL 2016 Year Game The monthly Dyalog APL 2017 Code Golf Challenge Make 12 snippets/expressions, in the same language, that result in ...
21
votes
15answers
7k 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 ...
10
votes
10answers
2k 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 ...
26
votes
8answers
2k 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 ...
53
votes
33answers
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 ...
19
votes
2answers
3k 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 ...
16
votes
27answers
4k views

Generate a pronounceable word

The challenge is simple: generate a word. Specifications: Word must be pronounceable. This is defined as "alternating between a consonant and a vowel." A consonant is one of the following letters: ...
15
votes
20answers
1k 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 ...
21
votes
8answers
1k 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 ...
15
votes
24answers
5k 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. ...
21
votes
35answers
1k views

All the k-mers/n-grams

Intro We have had histograms and counting, but not listing all of them. Every year, Dyalog Ltd. holds a student competition. The challenge there is to write good APL code. This is a language ...
6
votes
7answers
929 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 ...
6
votes
0answers
652 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 ...