To hide the turtle on the screen in Logo programming, you use the command hide turtle
or its convenient abbreviation, HT
. This action makes the turtle invisible, allowing the drawing it has created to be viewed without the turtle obstructing the final image.
Understanding the Hide Turtle Command
The primary purpose of hiding the turtle is to achieve a cleaner visual output. After the turtle has finished drawing a shape or design, its presence can sometimes distract from the artwork itself. By issuing the hide turtle
command, the turtle icon disappears from the canvas while its drawing remains visible.
Here's a quick reference for the commands used to control the turtle's visibility:
Command | Abbreviation | Description |
---|---|---|
HIDE TURTLE |
HT |
Makes the turtle invisible on the screen. |
SHOW TURTLE |
ST |
Makes the turtle visible on the screen again. |
Example of Hiding the Turtle:
Imagine you're drawing a simple square:
FORWARD 100
RIGHT 90
FORWARD 100
RIGHT 90
FORWARD 100
RIGHT 90
FORWARD 100
HT ; Hides the turtle after the square is drawn
In this sequence, after the square is completed, the HT
command ensures that only the drawn square is visible, not the turtle itself.
Why Hide the Turtle?
Hiding the turtle is a useful technique in various scenarios, especially when learning Logo in an educational setting:
- Cleaner Visuals: Allows for a clear view of the finished graphic without the turtle covering part of it.
- Final Presentations: Ideal when showcasing the completed artwork, as the turtle is often just an operational tool.
- Advanced Graphics: In more complex drawings, the turtle might briefly appear in areas where it shouldn't, and hiding it at opportune moments can smooth out animations or transitions.
Bringing the Turtle Back into View
If you need to make the turtle visible again to continue drawing or to reposition it, you can use the show turtle
command, or its abbreviation ST
. This command will immediately bring the turtle icon back onto the screen at its current position and heading.
Example of Showing and Hiding:
PENUP ; Lifts the pen so it doesn't draw
FORWARD 50
PENDOWN ; Puts the pen down to draw
CIRCLE 30 ; Draws a circle
HT ; Hides the turtle
WAIT 60 ; Pauses for a short time (e.g., 1 second)
ST ; Shows the turtle again
FORWARD 50 ; Turtle moves forward after reappearing
This sequence demonstrates how you can control the turtle's visibility dynamically within a program.
For more in-depth tutorials and to explore further Logo programming concepts, you can visit resources like Turtle Academy, which offers interactive lessons on using turtle graphics.