All posts

Loops and conditions for children: learning through skipping and songs

A skipping rope hanging in a U shape on the left, a circular arrow in the middle, and a music note on the right.

Every program, from a simple game to a huge app, is built from a few basic ideas. Two of the most important are loops (doing something again and again) and conditions (doing something only if something else is true).

The good news is that children already use both all the time. A skipping rhyme, a song with a chorus and the morning routine are full of loops and conditions. Pointing them out, and playing with them, is a lovely screen-free way to build the thinking behind coding.

What loops and conditions are

Explain them with things your child already does:

Idea In everyday words Example
Loop Do it again, a number of times "Jump 5 times."
Loop until Keep going until something happens "Keep stirring until it's smooth."
Condition Only do it if something is true "If it's raining, take your umbrella."
If... otherwise Choose between two things "If the light is green, go. Otherwise, wait."

You don't need the words "loop" and "condition" with young children. "Again and again" and "only if" work just as well. Children around 7 or older often enjoy learning the real names.

Skipping: loops you can feel

Skipping with a rope (or pretending to, for younger children) is a perfect way to feel a loop.

  • Count loops: "Jump 5 times." Then "Jump 10 times." The instruction stays short, but the action repeats.
  • Loop until: "Keep jumping until I clap." Your child has to keep checking for the signal while they jump.
  • Add a condition: "If the rope touches your feet, stop and start counting again from 1."

Ask afterwards: "How could I say 'jump, jump, jump, jump, jump' in a shorter way?" The answer, "jump 5 times", is exactly why loops are so useful in programs: they save writing the same step over and over.

Songs and clapping patterns

Many songs have a chorus that comes back after every verse. That's a loop too.

  • Find the repeat: "Which part of the song keeps coming back? How many times do we sing it?"
  • Clap a pattern in a loop: "Clap, clap, tap your knees" three times. Then let your child invent a pattern and say how many times to repeat it.
  • Loop inside a loop (for older children): "Clap twice, then stamp once. Do that whole thing 4 times." Count the claps together at the end: how many were there?

Music is full of patterns, which makes it a natural place to notice repeats.

Conditions in daily life

Conditions are everywhere in family routines. Turn them into a game:

  • Listen for "if": during the day, whenever someone says "if", your child shouts "condition!" (or raises a hand).
  • The "if" game: give rules like "If I touch my nose, you jump. If I touch my ear, you sit." Then mix them up quickly. Your child has to check the condition each time before acting.
  • Two choices: "If the card is red, put it on the left. Otherwise, put it on the right." Sorting with a rule is a condition in action.

The "if" game is also a great exercise in attention: children have to stop and check rather than just copy what you do.

Write a program for a person

Now combine everything. Ask your child to write (or draw) a short "program" for you to follow:

  1. Draw a picture for each action: jump, clap, spin, sit.
  2. Use a number to show repeats: a jump picture with "×3" means jump three times.
  3. Add one condition, for example a drawing of a dog: "If you see the dog card, sit down."

Then follow the program exactly. If it doesn't do what your child intended, look for the step to fix together. Swap roles so your child follows yours.

In Dologi, "Repeat moves" puzzles don't have enough slots for every step, so children tap a move to repeat it 2, 3 or 4 times to get the car to every star, just like turning "jump, jump, jump" into "jump 3 times".

In short

  • A loop repeats a step a number of times, or until something happens.
  • A condition means doing something only if something is true.
  • Skipping, songs with a chorus and clapping patterns are full of loops; family routines are full of "ifs".
  • Let your child write a short program with repeats and one "if", then follow it exactly.

Read more: A recipe is a program: everyday algorithms for children