Determining Rotation Angles and Defining Functions
In this exercise, you will write a turning function for your robot by calibrating the angles of rotation. Your final code will define the function for turning a given number of degrees.
Directions
Use the turn/spin command to determine the amount of wait time needed for your robot to turn 90 degrees.
Hint: You will have to adjust the speed, move very slowly :) After you have figured out the speed and the wait time for 90 degrees, determine the wait time for 1 degree.
Hint: The speed will stay the same. Hint #2: Use math ;) Read the following PDF about writing definitions in Python. Complete the exercises at the end of the selection; it is not necessary to record the answers in writing (though you may want to for your blog).
Using your new function for turning, write a program to make your Scribbler draw a square.
Hint: How many degrees are in the angles of a square? Extension
Write a program to make your Scribbler draw a star.
Hint: Think about how you would draw a star by hand. Hint #2: How many degrees are in the angles of a star? |
Deliverable
|