Skip to main content

Questions tagged [random]

Tasks involving random numbers and/or output.

11 votes
1 answer
1k views

Flip a coin in Lost

Lost is a 2-D programming language where the start position and direction of the ip are entirely random. Today we will be writing a Lost program which uses this randomness to simulate a coin flip. A ...
Wheat Wizard's user avatar
  • 99k
21 votes
38 answers
3k views

Find the odd one out

Challenge The goal of this challenge is to generate and output a \$16 \times 32\$ (height \$\times\$ width) grid where all cells contain a decoy character, except for a random single cell that ...
vengy's user avatar
  • 2,211
16 votes
21 answers
2k views

Spot The Difference

Challenge Generate two \$16 \times 16\$ grids, each initially filled with "@" symbols and spaces. Each cell in the grids should be independently filled with an "@" or a space, with ...
vengy's user avatar
  • 2,211
1 vote
8 answers
298 views

Alternating Random Series Sum To \$N\$ [closed]

Challenge Given a positive integer \$N \ge 3\$, generate an alternating series of \$N\$ random numbers within the range \$[1, N]\$, such that their sum equals \$N\$. Expressed mathematically as $$N = ...
vengy's user avatar
  • 2,211
5 votes
4 answers
508 views

3D Hide & Seek Word Puzzle

Challenge Create a 3D word puzzle where the cube's dimensions match the length of the input word. The uppercase word (A-Z) must be validly placed within the cube in one of the fixed orientations: ...
vengy's user avatar
  • 2,211
1 vote
3 answers
299 views

Yin-Yang Table Generator [closed]

I want an n*n table that is filled with black or white and the following conditions are satisfied in it: All cells of a 2*2 square in this table should not be the same color. All black and white ...
Shahnazi2002's user avatar
-3 votes
1 answer
240 views

Bingo Cards SVG Code [duplicate]

Generate the contents of an SVG file containing 6 bingo cards. Winner is the one that uses the shortest code. A qualifying answer has an output that can be directly pasted in a blank to get the ...
paki eng's user avatar
  • 175
19 votes
22 answers
3k views

Be big more often

Related You are a manager at a large number factory. You want to show everyone your business is doing well, by showing randomly chosen samples. Unfortunately, your business is not doing that well. But ...
The Empty String Photographer's user avatar
17 votes
18 answers
2k views

XOR of independent Bernoulli variables

In probability theory, a Bernoulli variable is a random variable which has a single parameter \$p\$, and is equal to 1 with probability \$p\$, and 0 with probability \$1-p\$. In this challenge, there ...
Command Master's user avatar
15 votes
10 answers
3k views

Elect the Doge of Venice

The Venetian election system was... complicated. The Great Council came together and put in an urn the ballots of all the councilors who were older than 30. The youngest councilor went to St Mark's ...
KeizerHarm's user avatar
  • 1,373
5 votes
4 answers
821 views

A randomly colored walk

Given two inputs, a distance \$d\$ and a number \$n\$ output a list of \$n\$ random colors which each have distance \$d\$ from the previous. Background A random walk is a path which is defined by ...
CursorCoercer's user avatar
13 votes
9 answers
953 views

Random point inside boundary

Given an ASCII art with simple closed paths using | and - (pipes and dashes), output a random point inside the boundary. Eg. ...
math scat's user avatar
  • 9,408
15 votes
13 answers
2k views

Generate an emoticon

Your task is to generate an emoticon of three characters, the first character being one eye, the second the mouth, and the third another eye. Each eye is a random one of these characters: ...
Peter's user avatar
  • 1,017
28 votes
32 answers
3k views

Output a random value from the last 16 values outputted

Output the numbers 1-16 (or any other set of 16 distinct items). Then, repeatedly, output a random value chosen uniformly from the last 16 items outputted. After the same item is printed 16 times in a ...
mousetail's user avatar
  • 12.7k
13 votes
16 answers
3k views

Create a bingo card generator

Bingo Bingo is a numbers game where players match randomly drawn numbers to the numbers on their cards. Each bingo card is a square grid with 25 spaces, and the columns of the grid are labeled with ...
Stewie Griffin's user avatar

15 30 50 per page
1
2 3 4 5
24