Times-table true or false

The micro:bit shows a times-table fact that may be wrong: A for true, B for false, and a score after ten questions.

Go to the code ↓

Lesson at a glance

45 to 60 minutes · Grades 4 to 6

maze.education/microbit/lessons/times-table-quiz

Grades
Grades 4 to 6
Time
45 to 60 minutes
The CAPS gives Coding and Robotics 2 hours a week (Coding and Robotics CAPS, Grades 4 to 6, page 22).
Level
Some experience
For 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 Robotics
Fits: Grade 6, Term 2 · Where it fits

Learning intentions

Learners will learn to:

  1. Recall multiplication facts to 10 x 10 quickly and check them.
  2. Use variables, random numbers and multiplication in a program.
  3. 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.

  1. Introduction

    5 to 10 minutes
    Retrieval practice

    What 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 statement

    Quick 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.

    1. 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?
    2. 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?
  2. Lesson development

    35 to 40 minutes
    1. 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.
    2. 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.
    3. Predict. Show the question 6x7=45. Ask: should the player press A or B? What will the board show, and what happens to score?
    4. 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.
    5. 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.
    6. 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
    InputProcessingOutput
    Button A is pressed (the player says true)Call check with true: if the fact really is true, add 1 to scoreA 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 scoreA tick or a cross, then the next question
    Flowchart
    1. Start: score and questions are 0
    2. ask: pick first and second from 2 to 9, and set answer to first x second
    3. 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
    4. Show the question, such as 7x8=56, and wait for A (true) or B (false)
    5. 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
    6. Add 1 to questions
    7. Is questions 10?Yes: show Score and the score, then set score and questions back to 0No: carry on
    8. Go back to ask for the next question
  3. Consolidation

    5 to 10 minutes
    1. Ask: how does the program know whether a question is true? Point to the decision in the flowchart.
    2. Ask: why was it useful to put the question in a function?
    3. 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.

A question such as 7x8=56 scrolls across; A means true and B means false. A right answer shows a tick and adds a point, a wrong one shows a cross, and after ten questions the score scrolls.
The program sometimes changes the answer by a random amount from -3 to 3, so learners must check each fact before pressing A or B.

These are the MakeCode steps. The other routes are on the lesson's web page.

Build it in MakeCode blocks

  1. Start a New Project. In Variables, make first, second, answer, score and questions.
  2. Open Advanced, then Functions, and make a function called ask.
  3. In ask: set first and second to pick random 2 to 9, set answer to first x second (the multiply block is in Math).
  4. Add an if with pick random true or false from Math: inside, change answer by pick random -3 to 3.
  5. Show the question with show string and a join block from Advanced, Text: first, x, second, =, answer.
  6. 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.
  7. Add on button A pressed calling check with true, and on button B pressed calling check with false. Call ask in on start.
  8. Test in the simulator, then Download.
The same blocks as text (to paste into MakeCode)
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.

Extension or homework

Challenges for learners who finish early, or to take further in a club or as homework.

  1. Challenge 1

    Let the player choose the times table first: A changes the table, B starts the quiz.

  2. Challenge 2

    Keep a high score in a variable, and show a trophy you draw with show leds when it is beaten.

  3. 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.

  1. How does the program make a wrong answer?
  2. What is the largest product the quiz can ask about with random numbers from 2 to 9?
  3. Why do we need the score variable to start at 0?
Exit question

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 forBeginningDevelopingAccomplishedExemplary
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

  • Problem: Every answer is marked wrong.Fix: Check the check function compares sayYes with (answer = first x second), and that button A sends true.
  • Problem: The question scrolls but the buttons do nothing.Fix: Check the button blocks call check, and that the function names match exactly.
  • Problem: A new question starts before I answer.Fix: 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 (opens in a new tab), 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 (opens in a new tab), 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 (opens in a new tab), 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.

Ready to teach it?

Get a micro:bit for every learner or pair, and let us train your staff to run lessons like this one.

More lessons

All lessons →
  • Grades 4 to 6

    Grades 4 to 645 to 60 minLevel: Getting started

    Shake-to-roll dice

    Shake the micro:bit to roll a number from 1 to 6, then roll 60 times and test whether the dice is fair.

    Subjects: Mathematics · Coding and Robotics

    Code with: MakeCodePurple MashPython

  • Grades 4 to 6

    Grades 4 to 645 to 60 minLevel: Some experience

    Rock, paper, scissors

    Shake to throw rock, paper or scissors: learners use a random number and if, else if and else to choose a picture.

    Subjects: Coding and Robotics · Mathematics

    Code with: MakeCodePurple MashPython

  • Grades 4 to 6

    Grades 4 to 645 to 60 minLevel: Some experience

    Compass

    Learners turn the micro:bit into a compass that shows N, E, S or W, then use it to map their school grounds.

    Subjects: Social Sciences · Coding and Robotics

    Code with: MakeCodePython

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.

WhatsApp