Peyton used a block coding program to get a sprite character to draw a shape. His sprite followed these steps:
Put pen down to write
Move \(10\) steps forward
Turn clockwise \(60\degree\)
Repeat steps \(2\) and \(3\) five more times
Here is the sprite’s drawing partway through the program:
What type of polygon did the sprite draw?
What type of pattern did Peyton use in this code?
If the code were changed so that step \(3\) reads "Turn clockwise \(45\degree\)", how would Peyton need to change step \(4\) in order to create a closed polygon?
The sprite moved \(10\) steps forward and then and turned \(60\degree\) clockwise a total of six times. By doing this, the sprite created a regular hexagon (with interior angles of \(120\degree\), which sum to \(720\degree\)). The completed hexagon is shown below.
Peyton used a repeating pattern in this code; continuing will retrace the hexagon.
If the code were changed so that step \(3\) reads "Turn clockwise \(45\degree\)", Peyton would have to revise step \(4\) to "Repeat steps \(2\) and \(3\) seven more times”, thus creating a regular octagon (with interior angles of \(135\degree\), which sum to \(1080\degree\)). The completed octagon is shown below.