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

Spot the bug

Week 9 · Unit 1 · 1.4 · 3 lessons
2

Find the bug

Computing 1: Topic 1.4, pp. 49–59
GoalTrace code to find which card is the bug.
New words
too many · more than we needwrong turn · a turn card that points the wrong way
Explanation

To find a bug, trace the code on the grid. Compare where the robot ends with where it should end. Look at the cards one by one. A bug may be one card too many. It may be a turn the wrong way. It may be a card missing.

tracegoalbug?
Worked examples
The robot should stop at the flower. Code: F F R F F F. It goes up two, turns right, and goes forward three. It goes past the flower. One F is too many.
The robot should go to the apple at the left. Code: F F R F F. It turned right, but the apple is on the left. The bug is the R. It should be L.
clearforwardforwardturn rightforward
Another bug: Mia pressed clear, forward, forward, turn right, forward, but never pressed GO. The robot did not move at all. The bug is the missing GO.
Class activity

Bug detectives: write a code of five cards on paper that gets a toy to a goal on the floor grid. Swap with a partner. Each of you changes one card in the other’s code so it has a bug. Trace the code to find your bug and say which kind it is.

Practice
1
The robot should reach the duck. Code: R F F F F. Which card is the bug?
2
The robot should reach the tree. Code: F F. It stops too soon. What is the bug?
3
The robot should go forward, turn right, forward. Code: X F L F GO. Which card is the bug?
clearforwardturn leftforwardGOGO
4
Name two kinds of bug in a robot code.