A random number: the dice
Section 2: VariablesLesson 2.2 ยท โฑ 7 min


๐ฒ random from 1 to 6 picks a different number every time, like a real dice. And ๐ณ vibrate shakes the real phone.
- Make it two dice: Label1 and Label2, each with a random number.
- Show the total of the two dice in Label3.
๐ Another example: two dice
Two random numbers and their total.



โ๏ธ Practise
Make the example yourself: put the parts in โ๐จ Designโ, then the blocks, and tap โถ Run.
โ๏ธ Practise here in the lessonโ Close the labor open the lab in a new page โ
๐ฏ Challenge yourself
Easy
A random number from 1 to 100.
๐ Show the solution๐ Hide the solution



Result: a number between 1 and 100.
Medium
A coin: heads or tails.
๐ Show the solution๐ Hide the solution



Result: heads or tails.
Hard
A dice that shows its face as a picture: โ โ โ โ โ โ (a list).
๐ Show the solution๐ Hide the solution



Result: one of the six faces.

