More things to do
Help Contents
The Logo Turtle
More things to do
More things to do
home, pu, pd, pd?
Except for these four actions - fd, bk, lt and rt, the turtle also knows how to jump directly to a special position, called home.
It is (usually) in the center of the screen. The name of the action is
home
. When you say this magic word the turtle jumps to its home and turns itself upward (i.e. it faces the upper side of the screen).
You've already noticed that as the turtle moves on the screen it leaves traces, so you can track its path.
Sometimes, when you draw something, it is so complex that it cannot be drawn as one path.
For this purpose you woule like to ask the turtle to stop leaving traces behind.
That's easy, because turtle traces are not because of its dirty feet, but because it carries a pen.
At startup the turtle puts the pen down, so that when it moves, the pen draws.
To ask the turtle to pick the pen up, use the instruction
pu
(pen up). From now one the turtle will move without leaving traces.
When you want to start to draw again, you should use the opposite instruction -
pd
(pen down).
At any moment you can check whether the pen is up or down. If you ask the turtle
pd?
it will respond with the word "true or "false.
if pd?
[ print "'Pen is down' ]
[ print "'Pen is up' ]