Step 1: Make it
What is it?
Finding hard to decide or agree on what to do? Let this micro:bit program choose for you!
These two videos show you what you'll make and how to code it:
Introduction
Coding guide
How it works
- Pressing button A makes your micro:bit choose a random number between 1 and 6.
- It stores the number in a variable called random_number.
- The program tests the random number using selection. Depending on the number, different activities are shown.
- It doesn't specifically test if the random number is 6 - why is this?
What you need
- micro:bit (or MakeCode simulator)
- MakeCode editor
- battery pack (optional)
Step 2: Code it
Step 3: Improve it
- Customise it by putting your own activities in the code.
- Add more activities.
- How could you make it less likely that it tells you to tidy your room?
This content is published under a Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) licence.