Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Turtle graphics
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Overview== [[File:Turtle-animation.gif|thumb|An animation that shows how the turtle is used to create graphics by combining ''forward'' and ''turn'' commands while a pen is touching the paper]] [[File:Turtle Graphics Spiral.svg|thumb|A spiral drawn with an [[Iteration|iterative]] turtle graphics algorithm]] [[File:Circle pattern.png|thumb|left|A turtle graphic pattern drawn with a [[Python (programming language)|Python program]]]] The turtle has three attributes: a location, an orientation (or direction), and a pen. The pen, too, has attributes: color, width, and on/off state (also called ''down'' and ''up''). The turtle moves with commands that are relative to its own position, such as "move forward 10 spaces" and "turn left 90 degrees". The pen carried by the turtle can also be controlled, by enabling it, setting its color, or setting its width. A student could understand (and predict and reason about) the turtle's motion by imagining what they would do if they were the turtle. [[Seymour Papert]] called this "body syntonic" reasoning. A full turtle graphics system requires control flow, procedures, and recursion: many turtle drawing programs fall short. From these building blocks one can build more complex shapes like squares, triangles, circles and other composite figures. The idea of turtle graphics, for example is useful in a [[Lindenmayer system]] for generating [[fractal]]s. [[Turtle geometry]] is also sometimes used in graphics environments as an alternative to a strictly coordinate-addressed graphics system.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)