Search this site
Embedded Files
Skip to main content
Skip to navigation
Sec 1 Coding 2018
Home
Class 1/1
Lesson 1: Introduction
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Class 1/2
Lesson 1: Introduction
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Lesson 13
Class 1/3
Lesson 1: Introduction
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Class 1/4
Lesson 1: Introduction
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Class 1/5
Lesson 1: Introduction
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Lesson 12
Sec 1 Coding 2018
Lesson 13
Games
The micro:bit can be used to create games. Let's create the Maths game.
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.
Report abuse
Report abuse