REDSTONEPEDIA › Circuits › Randomizers

Random picker: each press lights one output at random (randomizer)

1 of 2 outputs at random · 19 blocks

Each press lights one of its 2 outputs, picked at random, each half the time, and it stays on until the next press picks again.

Fair: its outputs came up 378 and 390 times in 768 presses.

the chosen output stays on until the next press · lights after 8 ticks (0.4 s) · fair over 768 presses · fits in 10×3×1

2 versions, 2 to 4 outputs

1 of 2 outputs at randomRandomizer3D view loading (or not available in this browser)

Every size 2

The best design for each size: pick one to see it.

sizeblocksnumbers
1 of 2 outputs (this page)19 blocksthe chosen output stays on until the next press · lights after 8 ticks (0.4 s) · fair over 768 presses
1 of 4 outputs40 blocksthe chosen output stays on until the next press · lights after 8 ticks (0.4 s) · fair over 1536 presses

Try it

Press IN under the view, holding it a moment like a button press: one of the outputs (A or B) lights and stays lit until the next press picks again, at random. Press play under the view to watch a demo on a loop; touch any other control to take over.

How this design does it: Two droppers face each other: one holds an iron shovel (the token), the other a cobblestone.

Build it

Download .litematic Download the design as text

The .litematic opens in Litematica (Minecraft 26.3): every block of the design in one region. The text file is the same build written as plain text, block by block.

Comes loaded with 1 iron shovel and 1 cobblestone in its containers: the download includes them; building it by hand, put them in first.

Blocks used: comparator dropper redstone wire repeater stone

Details: how it works, measurements and properties

In depth

each press lights exactly one of its outputs, picked at random, every output as often as the others

How to try it

Press play under the view to watch the demo on a loop (the badge reads demo with the step it is on; the same sequence is drawn as a timing diagram below). Touch any control to stop it and try the circuit yourself.

To try it: press and hold the IN button of the bar (or the cell tagged IN) to power that input; a quick tap sends a short 2-tick pulse.

Inputs are tagged in lime; the output is tagged A, B: the orange glass marker next to it glows while the output is on (the output strip by the demo badge shows its last 40 game ticks, 2 seconds). Drag to look around, pinch or scroll to zoom, step one game tick at a time with the step button.

Inputs and output over time

The input follows this schedule (the 3D view's demo plays the same). Lime: an input is on; orange: the output is on (taller = a stronger signal, 1 to 15). Time runs left to right in game ticks (20 ticks = 1 s).

INABticks01002003004005006007008009001000110012001300140015001600170018001900200021002200230024002500

Swipe the diagram sideways: the whole sequence lasts 2561 ticks (2 min 8.05 s).

Step by step (49 lines)
press 1: a
press 2: b
press 3: b
press 4: b
press 5: a
press 6: b
press 7: b
press 8: b
press 9: b
press 10: a
press 11: a
press 12: b
press 13: a
press 14: a
press 15: a
press 16: b
press 17: b
press 18: a
press 19: b
press 20: b
press 21: a
press 22: b
press 23: a
press 24: b
press 25: b
press 26: a
press 27: b
press 28: a
press 29: a
press 30: a
press 31: b
press 32: b
press 33: a
press 34: a
press 35: b
press 36: a
press 37: a
press 38: a
press 39: a
press 40: a
press 41: a
press 42: a
press 43: a
press 44: b
press 45: a
press 46: a
press 47: a
press 48: b
counts: 27 21

Measurements

metricvaluewhat it means
styleholdhold: the chosen output stays on until the next press; pulse: it gives one pulse
latency8 ticks (0.4 s)game ticks from a press to its output turning on, at the slowest
presses48presses in each run (24 per output, at least 48)

Notes from its designer

Press the button and one of the two outputs turns on at random, each half the time, and stays on until the next press picks again. Inside, two droppers face each other: one holds an iron shovel (the token), the other a cobblestone. A press fires both in the same tick; whichever fires first hands its item over, and the other then fires one of its two items back at random, so the shovel ends in either dropper with chance 1/2 whatever came before. A comparator reads each dropper (2 with the shovel, 1 with the cobblestone), two dusts bring that down to 1 or 0, and a repeater lights the output while the shovel is there.

Properties

StudyRandomizers
KindRandom picker: each press lights one output at random (randomizer)
Blocks placed19 (not counting the input levers or buttons the view adds)
Box10×3×1 (30 blocks of space)
Made of (the blocks that change state)comparator, dropper, redstone wire, repeater
Inputs / outputsIN (repeater) / A, B
Flagsseveral versions of one mechanism
Design filerand2-token

The design file

on GitHub

Design file (26 lines)
# Randomizer: 1 of 2 outputs at random · 19 blocks
# https://vjeux.github.io/redstonepedia/circuits/random/rand2-token.html
name: rand2-token
circuit: randomizer 2
port input: 0 2 0
port output.a: -4 0 0
port output.b: 5 0 0
nbt: 0 0 0 {Items:[{Slot:0b,id:"minecraft:iron_shovel",count:1}]}
nbt: 1 0 0 {Items:[{Slot:0b,id:"minecraft:cobblestone",count:1}]}
origin: -4 0 0
palette:
  R minecraft:repeater[delay=1,facing=east]
  r minecraft:repeater[delay=1,facing=west]
  w minecraft:redstone_wire[east=side,north=none,power=0,south=none,west=side]
  x minecraft:redstone_wire[east=side,north=side,power=0,south=side,west=side]
  C minecraft:comparator[facing=east,mode=compare,powered=false]
  c minecraft:comparator[facing=west,mode=compare,powered=false]
  D minecraft:dropper[facing=east,triggered=false]
  d minecraft:dropper[facing=west,triggered=false]
  S minecraft:stone
layer -1:
  SSSS..SSSS
layer 0:
  RwwCDdcwwr
layer 1:
  ....x