In Drawing a square we used the commands “move 50 steps” and “turn clockwise 90 degrees” four times each. To shorten this task we can use the repeat command. Wrapping blocks in a repeat allows us to reuse the logic.

A computer can only draw straight lines, but we can create the appearance of a curved line by drawing a bunch of of tiny lines that, when connected together, look like a circle

Since a circle has 360 degrees, we can create a circle by making 360 tiny lines, each one pixel long. After each line is drawn, we turn the pen 1 degree to the right.

What if you wanted to draw a circle to the left? You could repeat the same commands except change the command “right” to the command “left.”

We can also use the repeat command to easily make an equilateral triangle (a triangle in which the length of all three sides are equal). Since each of the internal angles must also be equal we can create a triangle by rotating the pen 120 degrees after each line is drawn.

## Leave a Reply