| turtle movement: | forward | backward | moveTo | home |
| turtle orientation: | left | right | turnTo | |
| turtle status: | getHeading | getX | getY | getPen |
| drawing control: | penUp | penDown | drawString | erase |
| arguments: | one integer (number of steps) |
| result: | moves the turtle the specified number of steps opposite the current heading - if the pen is down, a line will be drawn. |
| example call: | backward(20); |
| arguments: | one string (a message) |
| result: | displays the specified message at the current turtle location. |
| example call: | drawString("Here I am!"); |
| arguments: | none |
| result: | erases the turtle graphics screen (resets to all white). |
| example call: | erase(); |
| arguments: | one integer (number of steps) |
| result: | moves the turtle the specified number of steps in the current heading- if the pen is down, a line will be drawn. |
| example call: | forward(20); |
| arguments: | none |
| result: | returns the current heading of the turtle, a number between 0 and 359. Recall, 0 is straight up (north), 90 is straight right (east), 180 is straight down (south), and 270 is straight left (west). |
| example call: | currHead := getHeading(); |
| arguments: | none |
| result: | returns the current state of the turtle pen, either "up" or "down". |
| example call: | currPen := getPen(); |
| arguments: | none |
| result: | returns the current X-coordinate (horizontal axis) of the turtle. Recall, (0,0) is the center of the turtle graphics screen. |
| example call: | currX := getX(); |
| arguments: | none |
| result: | returns the current Y-coordinate (vertical axis) of the turtle. Recall, (0,0) is the center of the turtle graphics screen. |
| example call: | currY := getY(); |
| arguments: | none |
| result: | moves the turtle to the center of the turtle graphics screen (0,0), facing straight up - if the pen is down, a line will be drawn. |
| example call: | home(); |
| arguments: | one number (number of degrees) |
| result: | turns the turtle the specified number of degrees to the left, relative to the current heading. (Note: a full turn is 360 degrees) |
| example call: | left(90); |
| arguments: | two integers (X and Y coordinates) |
| result: | moves the turtle to the specified coordinates, with (0,0) being the center of the turtle graphics screen - if the pen is down, a line will be drawn. |
| example call: | moveTo(50,100); |
| arguments: | none |
| result: | puts the turtle pen down on the screen - any subsequent movement will cause a line to be drawn. |
| example call: | penDown(); |
| arguments: | none |
| result: | lifts the turtle pen up off the screen - no lines will be drawn regardless of turtle movement. |
| example call: | penUp(); |
| arguments: | one number (number of degrees) |
| result: | turns the turtle the specified number of degrees to the right, relative to the current heading. (Note: a full turn is 360 degrees) |
| example call: | right(90); |
| arguments: | one number (number of degrees) |
| result: | turns the turtle the specified heading, where 0 is straight up (north), 90 is straight right (east), 180 is straight down (south), and 270 is straight left (west). |
| example call: | turnTo(0); |