5. Case 02: Dice#

5.1. Purpose#

Use the Smart Coding Kit to make a wearable dice.

5.3. Software#

MicroSoftmakecode

5.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.

../../_images/smart_coding_kit_case_02_02.png

5.5. Result#

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

5.6. Exploration#

5.7. FAQ#

5.8. Relevant File#