 # Problem of the Week Problem B and Solution A Spritely Shape

## Problem

Peyton used a block coding program to get a sprite character to draw a shape. His sprite followed these steps:

1. Put pen down to write

2. Move $$10$$ steps forward

3. Turn clockwise $$60\degree$$

4. Repeat steps $$2$$ and $$3$$ five more times

Here is the sprite’s drawing partway through the program: 1. What type of polygon did the sprite draw?

2. What type of pattern did Peyton use in this code?

3. 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?

## Solution

1. 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. 2. Peyton used a repeating pattern in this code; continuing will retrace the hexagon.

3. 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. 