ุงู†ุชู‚ู„ ู„ู„ู…ุญุชูˆู‰
Robo EgyptRobo Egypt
โ˜ฐ Course contents
Robo Apps: home
0. Lab tour1
1. The start: your first app3
2. Variables2
3. Typing and maths2
4. Conditions3
5. Time2
6. Sound and speech2
7. Arranging the screen2
8. Lists2
9. Games3
10. Sensors2
11. Bluetooth with Robo Maker2
12. Your app on your phone1
13. The final project: catch the apple3

A random number: the dice

Section 2: VariablesLesson 2.2 ยท โฑ 7 min
When tapped: Label1 = a random number from 1 to 6, then the phone vibrates
When tapped: Label1 = a random number from 1 to 6, then the phone vibrates
We tapped โ€œRollโ€ and a number from 1 to 6 appeared
We tapped โ€œRollโ€ and a number from 1 to 6 appeared

๐ŸŽฒ random from 1 to 6 picks a different number every time, like a real dice. And ๐Ÿ“ณ vibrate shakes the real phone.

  1. Make it two dice: Label1 and Label2, each with a random number.
  2. Show the total of the two dice in Label3.

๐Ÿ“Œ Another example: two dice

Two random numbers and their total.

The design
The design
The blocks
The blocks
In the lab: after rolling
In the lab: after rolling
โœ๏ธ Practise
Make the example yourself: put the parts in โ€œ๐ŸŽจ Designโ€, then the blocks, and tap โ–ถ Run.
โœ๏ธ Practise here in the lessonor open the lab in a new page โ†—

๐ŸŽฏ Challenge yourself

Easy

A random number from 1 to 100.

๐Ÿ‘€ Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: a number between 1 and 100.

Medium

A coin: heads or tails.

๐Ÿ‘€ Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: heads or tails.

Hard

A dice that shows its face as a picture: โš€ โš โš‚ โšƒ โš„ โš… (a list).

๐Ÿ‘€ Show the solution
The design
The design
The blocks
The blocks
In the lab
In the lab

Result: one of the six faces.

Finished the lesson? Mark it so your progress counts.