Remember to start your file by importing both turtle and turtleBeads (as below) so your code will run properly. In order for this to work, your file must be in a folder that also contains turtleBeads.py. You can download a copy of that file here.
from turtleBeads import *
from turtle import *
Remember to test your functions as you go!
Turtle graphics drawing code can be stored in functions just like any other code. Write a function named corner that moves forward 50 units, turns left 90 degrees, and then moves forward 50 units again, drawing a corner. This function shouldn't have any parameters.
Now write code that calls corner four times, drawing a square.
If we wanted to create a stair-step structure instead of a square, we'd need to turn left as well as right. Define a function named stair that turns 90 degrees right before doing the same thing that corner does.
Note that if we call it once, it will just look like a corner. But because it draws in a different place relative to the turtle's starting position, if we call it multiple times, the orientation of the corners drawn will create a staircase.
Now write code that calls your stair function four times. Notice how the results are different from the code above where you called corner.
To take things a step further, it would be nice if we could control the size of the stairs. Write a function named customStair in the cell below that accepts one parameter. It should do the same thing as stair, but the length of each of the two line segments should be equal to the parameter value, so that by adjusting the parameter when calling it, you can make larger or smaller stairs.
For the final turtle graphics exercise, write code that calls your customStair function in at least two places. You're free to decide what parameters you want to use and you can call other functions if you wish.