Lesson at a glance
maze.education/microbit/lessons/times-table-quiz
- Grades
- Grades 4 to 6
- Time
- 45 to 60 minutesThe CAPS gives Coding and Robotics 2 hours a week (Coding and Robotics CAPS, Grades 4 to 6, page 22).
- Level
- Some experienceFor classes that have used the micro:bit and MakeCode once or twice.
- Board
- Any micro:bit
- Code with
- MakeCode blocks, with Python as an extension
- CAPS
- Mathematics, Coding and RoboticsFits: Grade 6, Term 2 · Where it fits
Learning intentions
Learners will learn to:
- Recall multiplication facts to 10 x 10 quickly and check them.
- Use variables, random numbers and multiplication in a program.
- Use a function so the same steps can run again and again.
Success criteria
Each learner can say:
- I can say quickly whether a times-table fact to 10 x 10 is true or false.
- I can use variables, random numbers and the multiply block to make a question.
- I can explain why the question is in a function, and say when the function runs.
- I can follow one question through the flowchart, from ask to the next question.
Competencies
From the Coding and Robotics CAPS places this lesson cites.
- C.2Present a simple coding solution
- C.5Evaluate a given solution towards potential improvement
Key words
- product
- The answer when you multiply two numbers.
- function
- A named set of instructions you can run whenever you need it.
- true and false
- The two answers a computer can give to a yes or no question.
- score
- A variable that counts correct answers.
- flowchart
- A diagram of the steps and decisions in a process, read from the top.
- IPO table
- A plan with three columns: the input, the processing and the output.
What you need
- One micro:bit per learner or pair, with a USB cable and a battery holder
- A computer with Chrome or Edge for each learner or pair
- Paper and pencils for the unplugged quiz
From our shop: BBC micro:bit V2 Go, BBC micro:bit V2.21 Next Gen Classroom Pack
Safety
- Keep USB cables tidy on the desk so nobody trips over them or pulls a laptop off the table.
- Use the battery holder with two AAA batteries. Never mix old and new batteries, and take the batteries out before the kits are packed away.
- Unplug the battery holder by holding its plug, never by pulling the wires.
The lesson plan
One lesson of 45 to 60 minutes in three parts: introduction, lesson development and consolidation. The CAPS gives Coding and Robotics 2 hours a week, so it fits one of the week's lessons. Times are a guide.
Introduction
5 to 10 minutesRetrieval practiceWhat does a pick random block do? (It picks a whole number by chance from a range, such as 1 to 6, so we cannot say in advance which number comes next.)
Problem statementQuick recall of the times tables makes long division and fractions much easier, and learners need a way to practise at break or in aftercare without a teacher marking every answer. Build a true or false quiz on the micro:bit that checks each answer and keeps score.
- Quick-fire true or false: read out facts such as 6 x 7 = 42 and 8 x 4 = 36. Learners show thumbs up or down. Ask: how did you know so fast? Which facts are hardest?
- Read the problem statement together. Ask: how could a computer make a fact that is wrong on purpose, and how would it know whether you were right?
Lesson development
35 to 40 minutes- Unplugged first. Pairs play the quiz on paper: one writes a fact that is true or slightly wrong, the other answers true or false, and they keep score. They are doing what the program will do.
- Plan on paper first. Pairs draw the quiz as a flowchart, from making a question to the score after ten questions, and fill in an IPO table for buttons A and B.
- Predict. Show the question 6x7=45. Ask: should the player press A or B? What will the board show, and what happens to score?
- Build in blocks. Pairs share one computer. The driver makes the five variables and builds the function ask from the Blocks tab; the navigator checks it against the top of the flowchart. Swap roles halfway: the new driver builds the function check and the two buttons, and the navigator checks the decisions.
- Test and debug. Play in the simulator: answer some questions right and some wrong on purpose. Did each tick and cross match your prediction? After ten questions, does the score match your own count? Then download it and play a round of ten.
- Look at how a wrong answer is made: sometimes the program adds a random number from -3 to 3 to the product. Ask: can that number be 0, and is the question still marked fairly if it is? (Yes: check works out whether the fact is true from first and second, not from whether it was changed.) Then change the random range from 2 to 9 to practise one table only, for example the sevens, and swap boards with a partner to try to beat their score.
Plan on paper: a model answer
In pairs, draw the quiz as a flowchart from one question to the next, then fill in an IPO table for the two buttons.
IPO table
Input Processing Output Button A is pressed (the player says true) Call check with true: if the fact really is true, add 1 to score A tick or a cross, then the next question Button B is pressed (the player says false) Call check with false: if the fact really is false, add 1 to score A tick or a cross, then the next question Flowchart
- Start: score and questions are 0
- ask: pick first and second from 2 to 9, and set answer to first x second
- Pick true or false at random. Is it true?Yes: change answer by a random number from -3 to 3No: leave answer as it is
- Show the question, such as 7x8=56, and wait for A (true) or B (false)
- check: does the player's answer match whether answer equals first x second?Yes: add 1 to score and show a tickNo: show a cross
- Add 1 to questions
- Is questions 10?Yes: show Score and the score, then set score and questions back to 0No: carry on
- Go back to ask for the next question
Consolidation
5 to 10 minutes- Ask: how does the program know whether a question is true? Point to the decision in the flowchart.
- Ask: why was it useful to put the question in a function?
- Back to the problem: could learners practise with this at break or in aftercare, with nobody marking? Each learner names one fact they want to practise tonight, and checks themselves against the success criteria.
Build it, step by step
Pairs build the program in blocks, following the numbered steps, with the same program as text beside them to check against or paste. Test in the simulator before sending it to a board.
These are the MakeCode steps. The other routes are on the lesson's web page.
Build it in MakeCode blocks
- Start a New Project. In Variables, make first, second, answer, score and questions.
- Open Advanced, then Functions, and make a function called ask.
- In ask: set first and second to pick random 2 to 9, set answer to first x second (the multiply block is in Math).
- Add an if with pick random true or false from Math: inside, change answer by pick random -3 to 3.
- Show the question with show string and a join block from Advanced, Text: first, x, second, =, answer.
- Make a second function called check, with a Boolean (true or false) input called sayYes. If sayYes = (answer = first x second), add one to score and show a tick, else show a cross. Count the question, and after ten show the score and start again.
- Add on button A pressed calling check with true, and on button B pressed calling check with false. Call ask in on start.
- Test in the simulator, then Download.
function ask () {
first = randint(2, 9)
second = randint(2, 9)
answer = first * second
if (Math.randomBoolean()) {
answer += randint(-3, 3)
}
basic.showString("" + first + "x" + second + "=" + answer)
}
function check (sayYes: boolean) {
if (sayYes == (answer == first * second)) {
score += 1
basic.showIcon(IconNames.Yes)
} else {
basic.showIcon(IconNames.No)
}
questions += 1
if (questions == 10) {
basic.showString("Score")
basic.showNumber(score)
score = 0
questions = 0
}
ask()
}
input.onButtonPressed(Button.A, function () {
check(true)
})
input.onButtonPressed(Button.B, function () {
check(false)
})
let questions = 0
let score = 0
let answer = 0
let second = 0
let first = 0
ask()To use the text instead: open MakeCode, start a new project, click JavaScript at the top, replace what is there with this code, then click Blocks to see it as blocks.
To send it to the board, click Download. In Chrome or Edge, MakeCode can connect to the micro:bit by USB so the program goes straight onto it. Otherwise a .hex file downloads: drag it onto the MICROBIT drive.
No Purple Mash route for this lesson
We could not find a Purple Mash unit or project that matches this lesson, so it is MakeCode blocks, with Python as an extension. These lessons have a Purple Mash route:
Extension: text-based coding, beyond the CAPS
The same program in MicroPython, for the micro:bit Python Editor. It suits Grade 7 to 9 learners who are ready for text-based code. The CAPS itself follows a block-based approach (Coding and Robotics CAPS, Grades 7 to 9, page 24).
# Times-table true or false: A if the fact is right, B if it is wrong.
from microbit import *
import random
score = 0
questions = 0
while True:
first = random.randint(2, 9)
second = random.randint(2, 9)
answer = first * second
if random.randint(0, 1) == 1:
answer = answer + random.randint(-3, 3)
display.scroll(str(first) + "x" + str(second) + "=" + str(answer))
button_a.was_pressed()
button_b.was_pressed()
while True:
if button_a.was_pressed():
said_yes = True
break
if button_b.was_pressed():
said_yes = False
break
sleep(20)
if said_yes == (answer == first * second):
score = score + 1
display.show(Image.YES)
else:
display.show(Image.NO)
sleep(500)
questions = questions + 1
if questions == 10:
display.scroll("Score " + str(score))
score = 0
questions = 0Python waits for an answer inside a loop, and clears any presses made while the question was scrolling.
Open the Python editor, replace the code that is there with this program (or open the downloaded file), then click Send to micro:bit. MakeCode also has a Python view, which is written a little differently.
Extension or homework
Challenges for learners who finish early, or to take further in a club or as homework.
- Challenge 1
Let the player choose the times table first: A changes the table, B starts the quiz.
- Challenge 2
Keep a high score in a variable, and show a trophy you draw with show leds when it is beaten.
- Challenge 3
Make a division version: show 24 ÷ 6 = 4 and ask true or false.
Support and extension
Support
For learners who need more help
- Practise one table only: set both random blocks so first is always 2, 5 or 10.
- Let learners use a times-table grid while they play, then take it away for a second round.
Extension
For learners who are ready for more
- Make the wrong answers harder to spot: only add -1 or 1.
- Add a timer with running time (ms) and show how many seconds the ten questions took.
Informal assessment
Ask these as learners work. Informal assessment happens every day and is not recorded.
- How does the program make a wrong answer?
- What is the largest product the quiz can ask about with random numbers from 2 to 9?
- Why do we need the score variable to start at 0?
The board shows 6x8=48 and you press B. What will it show, and does score change?
Observation checklist
Watch pairs as they plan, build and test. Write each pair's initials under the level you see.
| Watch for | Beginning | Developing | Accomplished | Exemplary |
|---|---|---|---|---|
| Draws the flowchart with the check decision and both of its answers. | ||||
| Predicts the right button and the result for a question, then tests it. | ||||
| Builds ask as a function and calls it after every answer. | ||||
| Answers times-table facts quickly and accurately. |
- Beginning:
- not yet, even with help
- Developing:
- with help
- Accomplished:
- on their own
- Exemplary:
- on their own, and explains it or takes it further
The four levels are the CAPS rubric levels (Coding and Robotics CAPS, Grades 4 to 6, page 176). The short descriptions are ours.
This lesson is not a formal task, but it is good practice for the term's practical task in Grades 4 to 6 (Coding and Robotics CAPS, Grades 4 to 6, page 170).
Common mistakes and fixes
- Every answer is marked wrong.Check the check function compares sayYes with (answer = first x second), and that button A sends true.
- The question scrolls but the buttons do nothing.Check the button blocks call check, and that the function names match exactly.
- A new question starts before I answer.Wait for the question to finish scrolling before you press, so presses are not mixed up.
Where it sits in CAPS
- Coding and RoboticsFitsGrade 6, Term 2: a program to practise a times table, with IF, THEN and ELSE and a repeat. Our version adds a function, which goes beyond the Grade 6 CAPS.Source: Coding and Robotics CAPS, Grades 4 to 6, Grade 6, Term 2, Coding, C.5 Evaluate a given solution towards potential improvement, page 140:
Mary wrote a program for her little sister to practise her 6x table.
- Coding and RoboticsFitsGrade 6, Term 3: multiplication and other calculations in a program.Source: Coding and Robotics CAPS, Grades 4 to 6, Grade 6, Term 3, Coding, C.2 Present a simple coding solution, page 149:
You have learned about the following calculations: plus, minus multiply and divide (+ - * /):
- MathematicsGrades 4 and 5 Mathematics: mental multiplication to at least 10 x 10 (Grade 6 goes on to 12 x 12).Source: CAPS Mathematics, Grades 4 to 6, Section 2, topic 1.1 Whole numbers, mental calculations (Grades 4 and 5):
Multiplication of whole numbers to at least 10 x 10
Coding and Robotics quotes come from the Department of Basic Education's final CAPS, with the page number of the 2024 printed edition (the Department's October 2025 library copies number their pages differently). Schools may teach a topic in another term: the CAPS leaves the order to each school's annual teaching plan.
micro:bit is a trade mark of the Micro:bit Educational Foundation, and BBC is a trade mark of the British Broadcasting Corporation. Maze Education is an independent reseller of genuine BBC micro:bit products. Our teacher training and our other products and services are our own, and are not endorsed by the Foundation or the BBC.

