3. The Four Basic Moves: Walking the Turtle
- The Four Basic Moves: Walking the Turtle
To move the turtle, you use simple commands followed by a number. This number, called an argument, tells the turtle what to do. For forward and backward, the number is a distance in steps (or units). For right and left, the number is an angle in degrees. A full circle is 360 degrees, so a command like rt 375 is the same as turning rt 15—it just completes a full circle and then turns a little more!
Here are the four most fundamental commands you’ll use:
| Command | What it Does |
| forward (or fd) | Moves the turtle forward a set number of steps. |
| backward (or back, bk) | Moves the turtle backward a set number of steps. |
| right (or rt) | Rotates the turtle to its right by a number of degrees. |
| left (or lt) | Rotates the turtle to its left by a number of degrees. |
Let’s try a couple of examples. Type these into the command box and press Enter.
fd 100
This command tells the turtle to move forward 100 steps, drawing a straight line.
rt 90
This tells the turtle to make a sharp right turn of 90 degrees. Think of it like turning a perfect corner on a city block.
Moving is great, but the real fun begins when the turtle leaves a trail behind it.