This activity assumes that you have completed How Far Will the Finch Turn?. Make sure you have already done that activity before you start.
You have an equation that relates wait time to the angle that the Finch turns. In this activity, you will use this equation to write a program that makes the Finch draw a polygon. The user will be able to choose how many sides the polygon will have!
Your program must meet the following requirements:
- It must ask the user for the number of sides of the polygon. To do this, you can use the ask and wait block on the Sensing menu. The user’s answer will be stored in a variable block named answer (also located on the Sensing menu).
- It must use the number of sides to calculate the angle that the robot will need to turn after it draws each side. This is 360°/answer because the robot has to turn a total of 360° to draw the entire polygon. Store this angle in a variable called angle.
- It must use your equation to calculate the wait time and store it in a variable called waitTime.
- It must use a repeat block (Control menu) to draw the polygon.
Draw several different polygons. What happens when the number of sides gets bigger? Why do you think this happens?