Skip to content
Programming Computational thinking
All classes Beginner About 12 min Free

Help the robot reach the battery

Put move and turn blocks in order so a robot crosses a 5 × 5 grid to its battery. Run a broken plan to find the block where it bumps into a wall, fix it, and then find the shortest plan.

Core concept

An algorithm is a list of exact steps done in order; changing the order or one step changes the result, and debugging means finding the step where the plan breaks

Topic: Computational thinking

An algorithm: A list of clear steps that solves a problem, like a recipe. All key words is a list of steps that solves a problem, like a recipe or the directions to a friend's house. A computer follows the steps exactly and in order: it never guesses what you meant. Here a robot understands only three blocks: move forward one square, turn left and turn right. A turn does not move the robot; it only changes the way it faces. If one block is wrong or in the wrong place, the robot ends up somewhere else, or bumps into a wall. Finding that block and fixing it is called debugging.

Key words explained

What you will learn

  • Explain what an algorithm is and why the order of steps matters.
  • Predict where a robot ends after a short list of blocks.
  • Find the block where a plan breaks and fix it (debugging).
  • Compare plans and find a shorter one.

Before you start

  • Know left and right, and the four directions north, east, south and west.

Materials

  • A notebook and a pencil to draw the grid

Equipment

  • None

Procedure

  1. Run the robot's first plan and see where it bumps into a wall.
  2. Build a new plan that reaches the battery, and run it.
  3. Make the plan as short as you can.
  4. Answer the practice challenges.