Driving · Robot club · about 20 min
Plan a path, drive it, leave a trail.
[1 mark]The robot starts facing down the mat, at heading 180. What does forward(60, distance=60) draw?
[1 mark]The robot is facing down the mat. Which command slides it towards the right of the mat, without turning?
left(60, distance=30)right(60, distance=30)turn_right(30, angle=90)backward(60, distance=30)[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.
[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.
left(60, distance=30)print("done at", position())forward(60, distance=60)connect()from bugbot import *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.
[1 mark]Which way of drawing the second stroke keeps the corner of the L sharpest?
[1 mark]Which of these letters need drive with rotation to draw well?
Tick every answer that is true.
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.
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.