Meet a drawing turtle
Why is it called a turtle?
Last updated
Why is it called a turtle?
Last updated
The turtle robot, a simple robot controlled from the user's workstation that is designed to carry out the drawing functions assigned to it using a small retractable pen set into or attached to the robot's body
A drawing turtle is going to have three attributes a location, an orientation (or direction), and a pen. The pen will have its own attributes: color, width, and on/off state.
When we program with a turtle, we are using body syntonic reasoning - in other words - we can predict and reason about the turtles movements by imagining what we would do if we were the turtle.
This is sequential code! One line executes AFTER the one before it has finished.
The # are programmer comments that clarify the action
Mock is the name of the object we created (mock is an instance of the turtle) and we are calling the method/function/procedure of forward. These methods already exist in the Python library.
The 100 is the value passed into the method as an argument. - allowing us to use this method for any number of steps we want the turtle to take.