The worksheetDownload the PDF
Answers

1.6 Project: draw a letter

Driving · Robot club · about 20 min

BugBotLab

What this lesson is about

Plan a path, drive it, leave a trail.

Questions 6 marks in all

  1. [1 mark]The robot starts facing down the mat, at heading 180. What does forward(60, distance=60) draw?

    1. AA line down the mat
    2. BA line up the mat
    3. CA line to the right
    4. DNothing, because forward means up the mat
    Answer: A. Forward is always the way the robot is facing. Facing down, forward draws the downstroke of the L.
  2. [1 mark]The robot is facing down the mat. Which command slides it towards the right of the mat, without turning?

    1. Aleft(60, distance=30)
    2. Bright(60, distance=30)
    3. Cturn_right(30, angle=90)
    4. Dbackward(60, distance=30)
    Answer: A. Left and right are from the robot's point of view. When it faces down the mat, its left is the mat's right.
  3. [1 mark]The robot faces down the mat at heading 180 and runs turn_left(30, angle=90). What does heading() say? Give a whole number of degrees.

    Answer: 90 (accept within 1). Turning left is anticlockwise, which takes degrees away: 180 minus 90 is 90, facing the right of the mat.
  4. [1 mark]Put these lines in order to draw an L with a strafe, starting at the top left facing down.

    Number the lines 1 to 5 to put them in the right order.

    1. left(60, distance=30)
    2. print("done at", position())
    3. forward(60, distance=60)
    4. connect()
    5. from bugbot import *
    Answer:
    from bugbot import *
    connect()
    forward(60, distance=60)
    left(60, distance=30)
    print("done at", position())

    The long downstroke comes first, then the short stroke. Facing down, left slides the robot to the right of the mat.

  5. [1 mark]Which way of drawing the second stroke keeps the corner of the L sharpest?

    1. AStrafing, because the robot does not turn
    2. BTurning, because the robot faces the way it goes
    3. CBoth are exactly the same
    4. DDriving backwards
    Answer: A. A turn adds a little error and a little wobble at the corner. A strafe goes straight from one stroke to the next.
  6. [1 mark]Which of these letters need drive with rotation to draw well?

    Tick every answer that is true.

    1. AT
    2. BS
    3. CE
    4. DO
    5. EH
    Answer: B, D. T, E and H are all straight strokes. S and O are curves, and a curve needs forward and rotation together.

The task: draw an L

Start at the top left facing down. Drive the long stroke into the corner zone, then the short stroke into the goal. The 60 by 30 L above finishes about 4 cm short of the goal, so measure the zones on the mat and plan your own lengths.

# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()

# stroke one, stroke two

The hint students can ask for: Start at the top left facing down. Drive down the long stroke into the corner zone, turn, and drive the short stroke into the goal. That draws an L.

A solution

from bugbot import *
connect()
forward(60, distance=55)
left(60, distance=45)

Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.