CEMC Banner

Problem of the Week
Problem B
Coding Figures

Ayanna writes programs using the following commands that direct her robot to draw shapes.

Command Explanation
Pencil down Puts the pencil in position to draw as the robot moves
Move Moves the robot a given distance forward
Turn CW Rotates the robot one quarter turn (\(90\degree\)) clockwise
Turn CCW Rotates the robot one quarter turn (\(90\degree\)) counter clockwise
  1. For each program, follow the code to draw the shape. You may find grid paper helpful.

    1. Pencil down 
      Repeat 4 times
         Move 5 cm
         Turn CW
      End
    2. Pencil down
      Move 4 cm
      Turn CCW
      Move 2 cm
      Turn CW
      Move 2 cm
      Turn CW
      Move 6 cm
      Turn CW
      Move 6 cm
      Turn CW
      Move 4 cm
      End
  2. Write a program that would direct Ayanna's robot to draw the given rectangular U-shape.

    The outer part of the U-shape has two vertical sides (left and right) that are each 5 cm long and a horizontal bottom side that is 10 cm long. The horizontal distance between the left sides of the inner and outer parts of the U-shape is 2 cm. The same is true for the right sides. The vertical distance between the bottom sides of the inner and outer parts of the U-shape is 2 cm.

Themes: Computational Thinking, Geometry & Measurement