pick random (1) to (10) — Scratch Block Guide
Generates a random number inclusively between the first and second values.
What this block does
Generates a random number inclusively between the first and second values.
Roll dice (1–6), choose random spawn x coordinates (-200 to 200), or vary enemy timing.
- Category: Operators Blocks
- Key tip: If both inputs are whole numbers, Scratch picks a whole number; include a decimal (e.g., 1.0) to get decimals.
Random & Probability 1,000-Trial Lab (pick random 1 to 6)
Run Scratch’s "pick random (1) to (6)" 1, 10, 100, or 1,000 times to watch each outcome converge toward the theoretical 16.7% probability.
Working Scratch example
Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.
- When green flag clicked
- Say (pick random 1 to 6) for 2 seconds
Try it: Simulates a fair 6-sided die roll.
Related block guides
Explore other blocks in the same category or return to the full English Block Dictionary.
FAQ
When should I use "pick random (1) to (10)" in Scratch?
Roll dice (1–6), choose random spawn x coordinates (-200 to 200), or vary enemy timing. If both inputs are whole numbers, Scratch picks a whole number; include a decimal (e.g., 1.0) to get decimals.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.