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

Debug it everywhere

Week 10 · 1.4 Spot the bug · 3 lessons
3

Robot delivery project

Computing 1: Topic 1.4, pp. 49–59
GoalPlan, write, test and fix a code to take a letter to a house.
New words
project · a bigger job with many stepstest · run it to see if it works
Explanation

Draw a small town on a grid. Pick a house for a letter. Plan a route to it. Write the code on cards. Test it. Does the robot reach the house? If not, find the bug, fix it and test again.

planwrite codetestfix
Worked examples
Plan: the letter goes to the house. The robot starts at the bottom left, facing up. Code: X F F R F F F GO.
Test: Amir writes X F R F F F GO for the same house. The robot ends one square too low. The letter does not arrive. The bug: one F is missing before the turn.
delivered!hooray
Fix and test again: Amir adds an F before the turn. Now the code is X F F R F F F GO. The letter arrives!
Class activity

Paper town: draw a grid of nine big squares on paper. Draw a few houses, a shop and a park. Choose a start square. Write a code to take a toy car to one house. A family member moves the car, one card at a time. Did it arrive? If not, find the bug together. Fix it and test again.

Practice
1
The start is the bottom left, facing up. Write the code to reach the school.
2
A partner’s code is X F F R F GO for the same school. Where does the robot stop? What is the bug?
3
What do you do after you fix the code?
4
Why is it good to ask someone else to test your code?