AdvertisementYour brand could be hereYour brand hereOn every Darslab page · students, parents and teachersinfo@darslab.comAsk for pricesPricesinfo@darslab.com
☰ Year plan · Computing

Robots that draw

Week 18 · Unit 8: Be an artist · 3 lessons
3

Follow a path

Computing 2: Unit 8, pp. 106–121
GoalWrite the steps that take a robot along a path to a goal.
New words
path · the line a robot follows from start to endstep · one instruction in an algorithmGO · the card that tells the robot to run its commands
Explanation

A robot can follow a path on a grid. We look at where it starts and which way it faces. We write one step for each move or turn. In this path the robot goes forward 3, turns right and goes forward 3. That is 7 steps, because each forward is one step. We can put the steps on command cards and press GO.

Worked examples
StepInstruction
1Forward
2Forward
3Forward
4Turn right
5Forward
6Forward
7Forward
The algorithm for the path in the picture above, one step in each row.
forwardforwardforwardturn rightforwardforwardforwardGOGO
The same algorithm as command cards. Press GO and the robot runs them from the first card to the last.
A different path. The robot starts on the right side of the grid, facing left. It goes forward 2, turns right and goes forward 3, so it reaches the star.
Class activity

Command cards: make cards for forward, back, turn left, turn right and GO. Make a grid on the floor and put a toy at the end. A partner is the robot. Lay the cards in a row for a path from the start to the toy. Then press GO: the robot does each card in order. Did it reach the toy? If not, find the card that is wrong and change it.

Practice
1
Write the algorithm for the path as numbered steps. The robot starts at the bottom right, facing up.
2
A robot starts on D4 facing down. It does forward, forward, forward, turn right, forward. Which square does it stop on?
ABCD4321
3
What does the GO card do?
4
The robot does forward, forward, forward, turn right, forward, forward, forward. How many times does it move forward?