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

Write it, fix it

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

Plan, test and share

Computing 2: Unit 8, pp. 106–121
GoalPlan your own drawing for a robot, test it and share it kindly.
New words
plan · to work out what to do before you starttest · to run an algorithm to see if it workscredit · to say who made something
Explanation

A good robot artist plans first. Draw the shape on squared paper. Write the algorithm. Look for a pattern, because a repeat makes it shorter. Test it by tracing it, and then by walking it. Fix any bug. When you share your work, say who made it. Ask before you share a picture of somebody else’s drawing.

planwritetestshare
Worked examples
A flag shape. The robot starts at the bottom left, facing up. It goes up the pole, then right, down, and back along the flag. Algorithm: start, marker down, forward 4, turn right, forward 2, turn right, forward 1, turn right, forward 2, stop.
ShapePattern?
flagno repeat
squarerepeat 4 times: forward 2, turn right
Look for a pattern. This flag has no repeated steps, so we cannot use a repeat. A square does have a pattern: repeat 4 times, forward and turn.
TestHow
1trace it with a pencil
2walk it yourself on the floor
3compare with the picture
4ask a friend to follow it
Four ways to test an algorithm.
Class activity

Robot artist: plan a drawing on squared paper using only straight lines and right-angle turns, such as a flag, a hook or a staircase. Write the algorithm. Count the steps. Trace it with a pencil. Then ask a friend to be the robot and walk it with chalk or tape. Fix any bug. At the end, write your name and your friend’s name on the picture as the makers.

Practice
1
Write the algorithm for this path. The robot starts at the top left, facing right.
2
Make this shorter with a repeat: forward 2, turn left, forward 2, turn left, forward 2, turn left, forward 2, turn left.
3
Plan a drawing of your own: choose a number or a letter with straight lines. Write its algorithm.
4
Name three ways to test an algorithm.