How-To Guide
CLASS 1
60
How to Use Random Numbers
To move the robot for a random amount of time, there is a new block we will be using to produce a random
number. Click the ‘Operators’ button in the palette.
If you click ‘Operators’ you will see ‘Random number between 1 and 10.’
Drag the block to the script and click it. If you click it, a number will appear at the right side of the block.
When you keep clicking the button, you will see the number change because this block produces a random
number between 1 and 10.
Since waiting for 10 seconds is a bit long, let’s change 10 to 5. Click ‘10’ and press 5 to change it.
Random numbers and Coding