Coding for ages 10–13: snap blocks that show the JavaScript-style line behind them, then type your own loops and conditions to steer a gem-hunting robot.
The robot and the gems
The robot is small and the job is clear: pick up all the gems, then park on the checkered flag. Your child writes the instructions. During the first half, each tapped block appears next to its JavaScript-style line: “move” beside moveForward();, the orange repeat block beside for (let i = 0; i < 3; i++) {. When Run is pressed, the active line glows as the robot moves.
The second half removes the blocks and the child types. Shortcut buttons insert commands and loop templates where the cursor is, which keeps phone and tablet typing practical.
| Levels | Concept |
|---|---|
| 1–4 | Sequences: move, turn, collect in the right order |
| 5–8 | for loops, with a loop nested in another |
| 9–10 | if (onGem()): one program for two or three worlds with different gems |
| 11–12 | while (!atGoal()): loop until the job is done |
| 13–15 | The same ideas, written out as text |
| 16–20 | Sensors pathAhead(), pathLeft(), pathRight() and if / else if / else to solve mazes the program has never seen |
Worlds are random every time, so copying a remembered solution fails.
What it teaches
Many children hit a wall when they move from blocks to typed code, since the two seem to have nothing in common. In this game a block and its line sit on the same row, so the link is easy to see. A block with a mouth is just a line opening with {, closed by a } lower down. Typing then feels like a familiar step.
Gems laid out as a staircase call for one set of four moves, repeated. Noticing this and putting the set inside a for loop is pattern recognition, and a shorter program is rewarded by the par counter.
When one program has to cope with three worlds, a fixed list of moves breaks. Only if (onGem()) { collect(); } works, and that is the jump from a list of steps to an algorithm that adapts.
Error messages come with a friendly note and a line number, so children learn that a mistake is a clue.
The last missions are mazes beaten by one rule: go ahead if the path is open, otherwise try left, otherwise turn right. A single rule that handles any maze of that type is a genuine idea from computer science.
Ways to help
- Pause before Run and ask which line comes next. Tracing a program in your head is the habit that pays off most.
- Read lines out loud as a pair. “For i from 0 while i is less than 3” sounds strange at first and ordinary a week on.
- A green counter is a good moment to ask what the loop saved.
- Leave typos alone and point at the message instead of fixing them.
- Take a break after level 12, because typing is a big step.
Away from the screen
Draw a grid, use coins as gems and write a pencil program with the same commands, while a parent acts as the robot and obeys it literally. Look for repeats in songs, stairs, knitting or dance steps and write them as a loop. Sketch a maze and try the rule “one hand on the right wall”. Where does it succeed, and where does it get stuck?
Easy slips
- Choosing the wrong turn when the robot faces the player. Picture yourself riding on top of it.
- Putting
collect();outside the loop, which gathers only the last gem. - A missing closing
}when typing. Match brackets in pairs as you go.