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

Program and run

Week 5 · 1.2 Floor robot beginnings · 3 lessons
3

Plan a route

Computing 1: Topic 1.2, pp. 19–32
GoalPlan a route on a grid and write the code that follows it.
New words
route · the way from the start to the endgoal · the place we want to reach
Explanation

First look at the start and the goal. Then say the route in words. Then change the words into code. Press clear first and GO last. At the end, trace your code to check it. There can be more than one right route.

clearforwardturn rightforwardforwardforwardGOGO
Worked examples
Plan: the robot starts at the bottom left facing up, and the goal is the duck. Say: forward one, turn right, forward three. Code: X F R F F F GO.
Plan: start at the bottom right facing up and reach the tree. Say: forward two, turn left, forward two. Code: X F F L F F GO.
Mud is a blocked square. Start at the bottom left facing up and reach the apple. Turn right first and go round the mud. Code: X R F F L F GO.
Class activity

Treasure plan: hide a toy on the floor grid. Mark a start square. Draw a route on paper, say it in words, then write the command cards. Give the cards to a partner. They lay out the cards, walk the code and find the toy. Did it work? Check the code if not.

Practice
1
The robot starts at the bottom left facing up. Write code to reach the flower.
2
The robot starts at the bottom left facing up. Write code to reach the star.
3
Your friend’s code is different from yours, but both reach the star. Is that fine?
4
What do you do at the end to check your code?