Pseudocode Task

Hint: This pseudocode describes how to draw a regular pentagon using basic drawing commands.

FUNCTION draw_regular_pentagon():
  side_length = 50 // UNITS are implied by drawing context
  number_of_sides = 5
  turn_angle = 360 / number_of_sides // DEGREES are implied
 
  PEN_DOWN() // Function call style
 
  FOR _ IN RANGE(number_of_sides):
    MOVE_FORWARD(side_length)
    TURN_LEFT(turn_angle)
  END FOR
 
  PEN_UP() // Function call style
END FUNCTION