NEW Explore the Scratch Block Dictionary, tutorials, textbook, and classroom guides

Start learning →

pick random (1) to (10) — Scratch Block Guide

📌 What you will learn

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

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.

Total trials: 0
1
0 (0.0%)
2
0 (0.0%)
3
0 (0.0%)
4
0 (0.0%)
5
0 (0.0%)
6
0 (0.0%)
repeat (1000) pick random (1) to (6)

Working Scratch example

Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.

Example using pick random (1) to (10)
  1. When green flag clicked
  2. 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.

Back to Operators Blocks See the overview and patterns for Operators Blocks. Learn more → Scratch Block Dictionary (All Categories) Browse Motion, Looks, Sound, Events, Control, Sensing, Operators, Variables, and Extensions. Learn more →

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.