Browse topics

Curriculum

Explore all 1,590 open curriculum concepts.

Advanced filters
ComputingAlgorithms & ProgrammingAges 9–13

Nested loops in code

Write, run, read and alter code (block-based or text-based) that places one loop inside another (for example a loop that draws a square, repeated with a turn after each square to make a rotating pattern), predict how many times the inner steps run altogether (outer repeats × inner repeats), and describe how changing the inner or the outer loop changes the outcome

Lesson

Set out your lesson

“Nested loops in code means practising the idea at the table with a simple screen-free or sandbox check. We will demo once, then your child tries.”

Bring to the table

  • Paper command cards (forward, turn, repeat) OR a free visual-blocks editor preview
  • Pencil
Extra for the adult

Worked example. Forward, forward, turn right reaches the star. Changing the order fails.

Optional challenge. For Nested loops in code, add one harder example after success.

What to notice. Keep one parent note: examples tried; results; support used. This session samples Nested loops in code, not mastery.

Continue learning
Share and support
Compare teaching approaches

Teaching approaches

Gakuva’s recommended starting approach is selected. You can still compare every option.

1 approach

Selected Default Gakuva

Nested loops in code means practising the idea at the table with a simple screen-free or sandbox check. We will demo once, then your child tries.

Materials: Paper command cards (forward, turn, repeat) OR a free visual-blocks editor preview; Pencil. 1. Say the goal of Nested loops in code in plain words once. 2. Adult lines up three command cards into a short sequence that reaches a goal. 3. Child builds three short sequences (or edits one) and tests whether the goal is met. 4. Fresh check: one fresh sequence that reaches the goal. Record and stop. Done: three tested sequences with pass/fail noted. Proof: parent note of examples and results. Stop: End after the fresh check; keep optional challenge for another day.

Family records and proof options

Keep a record of your learning

Save photos, notes, and attendance. Export a proof packet for compliance or portfolio reviews.

Practice this concept

Start practice
Gakuva activity

Nested loops in code practice

Practice key ideas from Nested loops in code.

Free · no login · no ads · Practice answers and completion are not saved. Parent observation remains the lesson record.

Learning resources

Extra practice links — they do not replace Gakuva’s teaching approach.

Code.org · Practice link — not the full lesson

Hour of Code

Open practice (new tab)
Before you open · source notes

Hour of Code supports Nested loops in code. An adult previews and guides; this is a learning page, not a scored quiz.

Free educational page, no sign-in required for the tested path.

Before you open

Ask the learner one fact they learned and one question they still have.

Opening this link does not save learning or assess mastery.

Source, access and review notes

Public Code.org page. An anonymous GET on 2026-11-12 returned HTTP 200 with no login or payment prompt for this URL. Opening the link does not save practice or assess mastery. An adult should preview and guide the learner.

Code.org. “Hour of Code.” External page; Gakuva does not copy, host, embed, or redistribute materials.

Unknown — link only

Check understanding

  • Write and run code with a loop inside a loop (e.g. repeat a 'draw a square' loop 6 times with a turn after each square) and check that the result matches the plan
  • Read a program with nested loops and predict how many times the inner action happens altogether (e.g. repeat 3 [repeat 4 [clap]] claps 12 times), then run it to check
  • Change either the inner or the outer repeat count in nested-loop code, then explain and test how the change affects what happens
“When your child codes — with blocks in an app like Scratch or with typed code — can they put one 'repeat' loop inside another, for example to draw a ring of squares, and say how many times the inside part will run before they run it?”

Curriculum record

Type
Procedural
Subject
Computing
Domain
Algorithms & Programming
Age range
Ages 9–13

Standards

the-ontario-curriculum-mathematics-2020:ON-MATH-2020-G4-C3.1the-ontario-curriculum-mathematics-2020:ON-MATH-2020-G4-C3.2the-ontario-curriculum-mathematics-2020:ON-MATH-2020-G5-C3.1the-ontario-curriculum-mathematics-2020:ON-MATH-2020-G5-C3.2the-ontario-curriculum-mathematics-2020:ON-MATH-2020-G6-C3.1the-ontario-curriculum-mathematics-2020:ON-MATH-2020-G6-C3.2the-ontario-curriculum-mathematics-2020:ON-MATH-2020-G7-C3.1the-ontario-curriculum-mathematics-2020:ON-MATH-2020-G7-C3.2