Nested loops
Nested loops run one loop inside another — the outer picks the row, the inner walks the columns. Grids, tables and patterns all come from this shape.
Roll a dice six times and anything can happen. Roll it six thousand times and mathematics shows up.
Loops inside loops let programs work across rows and columns, and repeated random trials let students simulate things that would be tedious to test by hand. This is the module where code starts answering questions rather than just performing tasks.
Simulation connects coding directly to probability and science. Students stop guessing what is likely and start measuring it.
Three core ideas, each taught with worked examples and then practised until it feels obvious.
Nested loops run one loop inside another — the outer picks the row, the inner walks the columns. Grids, tables and patterns all come from this shape.
Counters accumulate results across a loop: total, how many times, highest so far. Initialising them in the right place is the whole trick.
Random simulation runs an experiment thousands of times and measures the outcomes. The results converge on the mathematical answer, visibly.
This technique is called the Monte Carlo method, named after the casino. It was invented during the 1940s to solve physics problems no equation could crack.
“The dice is due for a six.” It is not, and your own simulation will prove it across ten thousand rolls.
Sessions 17–24 of the 72-session year, at two one-hour sessions per week.
Where this module fits, what you will build, and a hands-on starter that gets everyone curious about nested loops.
Guided teaching on nested loops, worked through together with the teacher.
Independent practice, small challenges and one deliberate mistake to diagnose.
Guided teaching on counters, building directly on the previous two sessions.
Applied tasks that combine nested loops and counters in one piece of work.
Random simulation introduced and practised, completing the toolkit needed for the project.
Guided build session for the module project: Dice experiment.
Finish, test against the checklist, present the work and explain the decisions behind it.
Every module ends with something the student built themselves and can demonstrate. This is the piece that goes into their portfolio and gets explained out loud at the end of session 24.
Simulate rolling two dice 10,000 times and count how often each total appears. Chart it and explain why 7 wins.
Students finishing Module 3 can:
The vocabulary introduced here, in plain language:
6 quick questions drawn from this module — vocabulary, the project you build, and a myth-or-fact round. Every wrong answer explains itself, so a mistake still teaches you something.
Tell us your child’s class and what they enjoy. We will suggest the closest program fit—no pressure and no upfront payment.