Let’s take a look at where the Small Basic Turtle object came from!
Turtle graphics were based on turtle robots, which were used in programming. In 1948, Grey Walter created his first robots, named Elmer and Elsie. People often thought his robots looked and moved like tortoises.
Years later, in 1967, two MIT professors (in Cambridge, Massachusetts) invented their PDP 1 computer. Kids from schools connected to it from phone lines. Because they didn’t have monitors, they wanted the kids to see robotics as the result of the programming. That led to the return of the turtle! Only this turtle was more like R2D2:
In order to program for this physical turtle, they created this concept of the display turtle as part of their Logo programming language:
(Logo comes from the Greek word, logos, which means “thought” or “word”, to differentiate that the language is based on words, graphics, and logic, and not just on numbers like most of the contemporary programming languages.)
Before long, most modern implementation of Turtle Graphics show the cursor as an actual turtle:
And that even extended to the turtle robots as well:
Similar to the Small Basic turtle, the Logo turtle included commands for relative movement and turning.
Here are the methods of the Turtle object in Small Basic:
- Turtle.X - Gets or sets the X location of the turtle. Setting this property changes the turtle’s horizontal location instantly without leaving any trace or turning its head.
- Turtle.Y - Gets or sets the Y location of the turtle. Setting this property changes its vertical location without leaving any trace or turning it direction.
- Turtle.Angle - Gets or sets the angle of the turtle. Setting this property turns the turtle to the new angle.
- Turtle.MoveTo(x, y) - Turns and moves the turtle to the new location. If the pen’s down, the turtle draws a line as it moves.
- Turtle.Move(distance) - Moves your turtle a number of steps in its current direction. If the distance is negative, the turtle moves backwards. If the pen’s down, your turtle draws a line as it moves!
- Turtle.Turn(angle) - Turns your turtle by an angle (in degrees) from its current direction. If the angle’s positive, the turtle turns to its right (clockwise). If the angle’s negative, your turtle turns to its left (counterclockwise).
- Turtle.TurnRight() - Turns your turtle 90 degrees to its right.
- Turtle.TurnLeft() - Turns the turtle 90 degrees to its left.
- Small Basic Reference Documentation: Turtle Object
- Small Basic Curriculum: Lesson 2.2: Turtle Graphics
Have a turtle-tastic day!
- Ninja Ed