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
2

Draw a letter

Computing 2: Unit 8, pp. 106–121
GoalWrite an algorithm for a robot with a marker to draw a letter or a number.
New words
marker · a pen on a robot that draws a line as it movesmarker down · the robot draws a line when it movesmarker up · the robot moves without drawing
Explanation

Some robots hold a marker. With the marker down, the robot draws a line as it moves. With the marker up, it moves without drawing. To draw a letter, we write an algorithm. It starts, puts the marker down, moves and turns, and stops. The robot draws only what we tell it to draw.

StepInstruction
1Start
2Marker down
3Forward 4
4Turn left
5Forward 2
6Turn left
7Forward 4
8Stop
Worked examples
The robot follows the algorithm above. It starts at the top left, facing down. It draws the letter U.
What if step 2 is left out? The robot walks the same path but the marker is up, so it draws nothing. The grid stays empty.
Another algorithm: start, marker down, forward 2, turn right, forward 4, stop. The robot starts at the top left, facing right. It draws the number 7.
Class activity

Draw with a marker robot: draw a grid of 3 columns and 5 rows on a big sheet of paper. Choose one child to be the robot with a crayon. The crayon on the paper means “marker down” and a lifted crayon means “marker up”. A partner reads the algorithm for the letter U one step at a time. Then try the algorithm for the number 7. (You can also use a pencil and your own finger on squared paper.)

Practice
1
The algorithm for the number 7 is: start, marker down, forward 2, turn right, forward 4, stop. Change one step so that the top line of the 7 is 3 squares long.
2
What happens if “marker down” is missing from an algorithm?
3
The robot draws this letter. Which letter is it?
4
Count the steps in this algorithm: start, marker down, forward 4, turn left, forward 2, turn left, forward 4, stop.