Skip to main content

Case 02: Dice

Purpose

Use the Smart Coding Kit to make a wearable dice.

1 x ELECFREAKS micro:bit Smart Coding Watch Kit

Software

MicroSoftmakecode

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.

Link:https://makecode.microbit.org/_bVWYUH2qRPKJ

You can also download it directly below:

Result

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

Exploration

FAQ

Relevant File