New programming concept
Randomisation
A random number is chosen without a predictable pattern. The pick random 1 to 6 block gives every roll one number in that range.
Important: One roll cannot prove that a dice is fair. Test many rolls and make a tally.
Try it here
Roll several times
Result: 1
Do you get every number? Do some repeat?
MakeCode steps
Build the dice
- 1
- 2
Add the shake event
From Input, add on shake.
- 3
Add show number
Place show number inside on shake.
- 4
Replace zero
From Math, put pick random 0 to 10 into show number.
- 5
Set the dice range
Change the first number to 1 and the second to 6.
on shakeshow number pick random 1 to 6 - 6
Test many rolls
Roll at least 12 times and keep a tally. Compare with another team.
Optional videos
Watch the official guides
Visit the official Dice projectFor the teacher
A calm 55-minute plan
Real dice warm-up
Predict, roll, and discuss uncertainty.
Introduce random
Name the range 1 through 6.
Guided build
Reuse the familiar shake event.
Tally test
Collect at least 12 results.
Compare
Discuss repeats and fairness cautiously.
Before you finish