Terrapin Resources
Erasing the Graphics Canvas

DRAW     CLEAN     CLEARSCREEN     UNDO     REDO

Now that you have learned to draw with the turtle, you will want to erase your picture and start a new one.
There are three commands to do this. Let’s see how they are different.


DRAW


DRAW erases the Graphics canvas, where the turtle draws, and totally resets the turtle.

Here is what DRAW does:

  • Clears (erases) the drawing canvas.
  • Resets the turtle to its original state.
  • Moves the turtle to its Home in the center of the screen.
  • Shows the turtle.
  • Puts the pen down.
  • Sets its shadow to 0.
  • Unlocks its heading.
  • Sets the drawing canvas to WRAP mode.
  • Removes any bounds you have set (see Graphics Panel Commands).

If you were using multiple turtles, DRAW puts them all back to their original values and makes Turtle 0 be the active turtle. To learn how to control more than one turtle, see Multiple Turtle Commands.

» Things to Watch Out For

The UNDO command (see below) does not “undo” a DRAW command.


CLEAN


CLEAN erases the Graphics canvas, but does not change the turtle’s position or heading.

» Things to Watch Out For

You can use UNDO command (see below) to “undo” a CLEAN command.


CLEARSCREEN
CS


CLEARSCREEN is like CLEAN, but it moves the turtle back to its Home position, pointing straight up.

» Things to Watch Out For

You can use UNDO command to “undo” a CLEARSCREEN command.


UNDO




Typing UNDO is the same as clicking the red Undo button in the menu bar at the top of the screen.
It “undoes” the last graphics command(s) you typed.

If you have entered many commands on the same line, UNDO undoes all of them at once.

REPEAT 10 [FD 20 RT 36]

UNDO

In this case, UNDO erases your entire drawing!

If you enter one command on a line, UNDO will undo just the last instruction.

FD 20
RT 36
FD 20
UNDO

UNDO will remove only the last FD 20.

» Things to Know

The Undo button in the menu bar will become dim when there is nothing more to Undo.
The UNDO command will not do anything if there is nothing to undo.

You can use UNDO inside programs you write!


REDO




Typing REDO is the same as clicking the green Redo button in the menu bar at the top of the screen.
It “redoes” the last line of graphics commands you have entered.

» Things to Know

The Redo button in the menu bar will become dim when there is nothing more to Redo.
The REDO command will not do anything if there is nothing to redo.

You can use REDO inside programs you write.