Hands-On Science Lab

Sections › Coding › Grid Treasure Code

Grid Treasure Code

Write step-by-step code to move a 'robot' across a paper grid to the treasure. Find the bugs and shorten it with loops.

CodingAges 8–1135 minutesFamily plan
Age8–11
Time35 minutes
DifficultyMedium
SectionCoding

How it started

My daughter wrote a program to get her toy dinosaur to a coin. It walked straight off the edge of the map. 'Bug!' her brother shouted with enormous pleasure. She fixed it, then he challenged her to do it in fewer moves, and the game went on until bedtime.

What you need

1sheet of squared paper or a 6×6 grid drawn on A4
1small toy or counter as the robot
1coin or sticker as the treasure
3–4small obstacles (erasers, Lego bricks)
1pencil and arrow cards: F (forward), L (turn left), R (turn right)

What your child will learn

  • Sequencing
  • Debugging
  • Loops
  • Spatial reasoning

Key words: algorithm, sequence, bug, debug, loop

🔒 The full lesson is part of the Family plan

Unlocks the 8 illustrated steps, safety notes, the science for kids and parents, problems and fixes, variations, the printable record sheet, the 5-question quiz and the parent guide.

A free account gets this month's two free activities in full:

See Family plans Sign in