Lesson 13
Games
Games
The micro:bit can be used to create games. Let's create the Maths game.
Task
Task
- Program the micro:bit to create a subtraction game.
- It will display 2 random numbers. The first and second number will be from 0 - 9.
- Only deal with positive numbers.
- When Button A is pressed, micro:bit will display the question.
- The user will press Button B to find the answer.
- Every time Button B is pressed, the number displayed is increased by 1.
- If the number is more than 9, it will restart from 0.
- The user will enter the answer by pressing both Button A and B.
- If the answer is correct, right icon will be diplayed.
- If the answer is incorrect, wrong icon and the correct answer is displayed.
- Then, "NEXT" is displayed and the micro:bit will continue to the display the next question.