Skip to main content

Algorithmic thinking through games: 5 examples for kids

The PEEMS team · Published November 10, 2026 · 6 min read

A Pemi CS level that paints a pattern with loops

Algorithms are not only for computers. This article introduces five ideas, sequence, loops, conditions, pattern-spotting and sorting, each tied to a game level and a small activity you can try at home.

"Algorithm" sounds like a grown-up word, but the idea is very familiar: a clear series of steps to get a job done. A recipe, a tooth-brushing routine and the way from home to school are all algorithms. Children can get used to this idea through games, and this article picks five examples, each tied to a Pemi CS level and a small activity you can do at home. If you'd like the wider background first, read What is computational thinking?.

Example 1: Sequence, what comes first and what comes next

The idea: a computer does exactly the steps you give it, in exactly the order you give them. Change the order and the result changes.

A Pemi CS level for young learners: driving Pemi with arrow buttons, each move becoming a picture block

In this level, the child drives Pemi to the flag with arrow buttons. Each press adds a picture block to the program. When they press Run, Pemi repeats the whole sequence. The child sees it straight away: "whatever I tell Pemi to do, Pemi does exactly that."

Try it at home: write the steps for making a glass of lemonade together. Then you play the "robot" and do exactly what is written. A missing step (forgetting to get a glass, say) shows up at once.

Example 2: Loops, don't repeat yourself by hand

The idea: when something repeats, tell the computer to repeat it instead of writing it out many times.

A Pemi CS level: using a repeat block to lay bridges across river channels

In this level, Pemi has to lay bridges across several channels, and each place needs the same series of actions. Instead of dragging the same group of blocks three times, the child puts them inside one repeat 3 block. The program is shorter and easier to read, and more importantly the child spots for themselves that "this repeats".

Try it at home: when your child lines up tiles or threads beads, ask, "Which step keeps repeating?" Then try saying "green, red, repeat 4 times" instead of naming every bead.

Example 3: Conditions, if this, then that

The idea: a program can choose different actions depending on the situation.

A Pemi CS level: filling in the blank slots in a program with an "if it sees a crate" condition

In the level "Crates for the cellars", Pemi walks along a corridor and meets crates. The child fills in the blank slots so the program understands: if there is a crate ahead, then push it towards the cellar; otherwise carry on. One program copes both when a crate is there and when it isn't.

Try it at home: play "If... then" while tidying: "If it's a book, put it on the shelf; if it's a shirt, put it in the wardrobe." Your child can invent more rules.

Example 4: Spotting patterns, seeing what repeats

The idea: before writing a program, check whether the situation has a pattern. A pattern makes the program shorter.

A Pemi CS level: painting cells into green stripes with nested loops

In "Green stripes", Pemi has to paint cells row by row. Looking at one cell at a time, the job is long and messy. But once the child sees that "each row has three cells, and there are three rows like it", they use one repeat block inside another. The pattern is the key.

Try it at home: ask about the pattern on floor tiles, a row of lamp posts or the days of the week: "What repeats? What comes next?"

Example 5: Sorting, checking that everything is in order

The idea: many everyday jobs are about putting things in order and checking the order: lining up, arranging books, ranking scores from low to high.

A Pemi CS level in Python: the is_sorted function checks whether the numbers on a bookshelf are in order

"Is the shelf in order?" is a level for older students. They write a function that checks each pair of neighbouring numbers: if any pair is in the wrong order, the shelf is not in order. This is a genuine algorithm, simple and useful, and it uses both the loops and the conditions from the earlier examples.

Try it at home: shuffle a few number cards and let your child find a way to put them in order from smallest to largest. Ask, "How can you be sure it's right?" When your child explains how they did it, they are writing an algorithm.

How do these ideas connect?

The five examples don't stand alone. Sequence is the root. Loops and conditions keep programs short and flexible. Spotting patterns is the thinking you do before you write. Sorting is a problem in which all of these ideas work together. In Pemi CS, these ideas are spread across more than 3,000 levels, from picture blocks to Python, so each child can move at their own pace.

A few tips for playing together

  • Let your child try first, and only then offer a hint.
  • Ask "why" more than "right or wrong". Being able to explain how they did it matters more than getting the answer.
  • Allow mistakes. Getting it wrong and fixing it is how coding is mostly learned.
  • Keep sessions short. 10 to 20 minutes is plenty, depending on age and your family's routine.

Frequently asked questions

What is an algorithm, in simple terms? It is a clear series of steps for getting a job done, so clear that a person or a computer following each step exactly gets the result you wanted. A recipe is a familiar example.

What age can children start getting used to this? There is no single age for everyone. From preschool, children can get used to sequence and repetition through games and screen-free activities. Ideas such as conditions or sorting usually suit older children.

Do children need a computer to learn algorithmic thinking? No. Many activities, like the ones above, need no screen at all. Game levels let a child see results straight away and are one more option for families.

Does my child need to read to play these levels? For young children, picture blocks use images and arrows, so no reading is needed. Levels with words suit children who can already read.

Want to try it together?

Pemi CS has levels for different ages, so you can try a few with your child and see how they work out the steps. It is open now and international families are welcome to register their interest by email.

Keep reading: What is computational thinking, and why should children start early? · From block coding to Python: when is the right time to switch?

The PEEMS team

Nov 10, 2026

Computational thinking is not knowing how to use a computer. It is a way of breaking problems down, spotting patterns and writing clear steps, and children can practise it without a screen.

Nov 10, 2026

Switching to Python too early frustrates children; too late and they get bored. This article lists signs of readiness, a path from picture blocks to text blocks to Python, and why ideas should come before syntax.

Nov 10, 2026

Your child talks about 'loops', 'variables' or 'bugs' and you are not sure what they mean? Ten common terms, each explained in two sentences with an everyday example.