4. Case 02: Dice

4.1. Purpose

  • Use the Smart Coding Kit to make a wearable dice.

4.2. Materials

  • 1 x smart coding kit


4.3. Software


4.4. Programming

  • Drag out an on shake block from input. Create a variable num and assign value to this variable with a random number among 1-6.

  • Insert a if block. If the picked random number is 0, then display one point. If the random number is 2, then display two points. And so on.


4.5. Result

  • A random number will be created each time when we shake our micro:bit.

4.6. Exploration

4.7. FAQ

4.8. Relevant File