The performer Turtle acts on a plane with a Cartesian coordinate system. At the initial moment, the Turtle is at the origin of coordinates, its head is directed along the positive direction of the y-axis, the tail is lowered. With the tail lowered, the Turtle leaves a trail in the form of a line on the field. At each specific moment, the position of the performer and the direction of his movement are known.
The performer has commands:
Forward n
and
Back n
(where
n
– is an integer), causing the Turtle to move by
n code> units in the appropriate direction, Right m
and Left m
(where m
– is an integer) causing the direction to change to m
degrees clockwise or counterclockwise respectively.
Recording
Repeat k [Command1 Command2 … CommandS]
means that the sequence of S
commands will be repeated k
times.
Determine the number of segments that make up the figure given by the following algorithm:
Repeat 67 [Forward 10 Right 20]