Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
82c276ea
Commit
82c276ea
authored
Jul 03, 2006
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document functions added in 2.3 and 2.5.
parent
2b88f63a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
4 deletions
+75
-4
Doc/lib/libturtle.tex
Doc/lib/libturtle.tex
+75
-4
No files found.
Doc/lib/libturtle.tex
View file @
82c276ea
...
...
@@ -42,6 +42,19 @@ means line are drawn more slowly, with an animation of an arrow along the
line.
\end{funcdesc}
\begin{funcdesc}
{
speed
}{
speed
}
Set the speed of the turtle. Valid values for the parameter
\var
{
speed
}
are
\code
{
'fastest'
}
(no delay),
\code
{
'fast'
}
,
(delay 5ms),
\code
{
'normal'
}
(delay 10ms),
\code
{
'slow'
}
(delay 15ms), and
\code
{
'slowest'
}
(delay 20ms).
\versionadded
{
2.5
}
\end{funcdesc}
\begin{funcdesc}
{
delay
}{
delay
}
Set the speed of the turtle to
\var
{
delay
}
, which is given
in ms.
\versionadded
{
2.5
}
\end{funcdesc}
\begin{funcdesc}
{
forward
}{
distance
}
Go forward
\var
{
distance
}
steps.
\end{funcdesc}
...
...
@@ -94,6 +107,16 @@ usage is: call \code{fill(1)} before drawing a path you want to fill,
and call
\code
{
fill(0)
}
when you finish to draw the path.
\end{funcdesc}
\begin{funcdesc}
{
begin
\_
fill
}{}
Switch turtle into filling mode; equivalent to
\code
{
fill(1)
}
.
\versionadded
{
2.5
}
\end{funcdesc}
\begin{funcdesc}
{
end
\_
fill
}{}
End filling mode, and fill the shape; equivalent to
\code
{
fill(0)
}
.
\versionadded
{
2.5
}
\end{funcdesc}
\begin{funcdesc}
{
circle
}{
radius
\optional
{
, extent
}}
Draw a circle with radius
\var
{
radius
}
whose center-point is
\var
{
radius
}
units left of the turtle.
...
...
@@ -113,6 +136,49 @@ Go to co-ordinates \var{x}, \var{y}. The co-ordinates may be
specified either as two separate arguments or as a 2-tuple.
\end{funcdesc}
\begin{funcdesc}
{
towards
}{
x, y
}
Return the angle of the line from the turtle's position
to the point
\var
{
x
}
,
\var
{
y
}
. The co-ordinates may be
specified either as two separate arguments, as a 2-tuple,
or as another pen object.
\versionadded
{
2.5
}
\end{funcdesc}
\begin{funcdesc}
{
heading
}{}
Return the current orientation of the turtle.
\versionadded
{
2.3
}
\end{funcdesc}
\begin{funcdesc}
{
setheading
}{
angle
}
Set the orientation of the turtle to
\var
{
angle
}
.
\versionadded
{
2.3
}
\end{funcdesc}
\begin{funcdesc}
{
position
}{}
Return the current location of the turtle as an
\code
{
(x,y)
}
pair.
\versionadded
{
2.3
}
\end{funcdesc}
\begin{funcdesc}
{
setx
}{
x
}
Set the x coordinate of the turtle to
\var
{
x
}
.
\versionadded
{
2.3
}
\end{funcdesc}
\begin{funcdesc}
{
sety
}{
y
}
Set the y coordinate of the turtle to
\var
{
y
}
.
\versionadded
{
2.3
}
\end{funcdesc}
\begin{funcdesc}
{
window
\_
width
}{}
Return the width of the canvas window.
\versionadded
{
2.3
}
\end{funcdesc}
\begin{funcdesc}
{
window
\_
height
}{}
Return the height of the canvas window.
\versionadded
{
2.3
}
\end{funcdesc}
This module also does
\code
{
from math import *
}
, so see the
documentation for the
\refmodule
{
math
}
module for additional constants
and functions useful for turtle graphics.
...
...
@@ -134,16 +200,21 @@ Define a pen. All above functions can be called as a methods on the given
pen. The constructor automatically creates a canvas do be drawn on.
\end{classdesc}
\begin{classdesc}
{
Turtle
}{}
Define a pen. This is essentially a synonym for
\code
{
Pen()
}
;
\class
{
Turtle
}
is an empty subclass of
\class
{
Pen
}
.
\end{classdesc}
\begin{classdesc}
{
RawPen
}{
canvas
}
Define a pen which draws on a canvas
\var
{
canvas
}
. This is useful if
you want to use the module to create graphics in a ``real'' program.
\end{classdesc}
\subsection
{
Pen and RawPen Objects
\label
{
pen-rawpen-objects
}}
\subsection
{
Turtle,
Pen and RawPen Objects
\label
{
pen-rawpen-objects
}}
\class
{
Pen
}
and
\class
{
RawPen
}
objects have all the global functions
described above, except for
\function
{
demo()
}
as methods, which
manipulate the given pen.
\class
{
Turtle
}
,
\class
{
Pen
}
and
\class
{
RawPen
}
objects have all the
global functions described above, except for
\function
{
demo()
}
as
m
ethods, which m
anipulate the given pen.
The only method which is more powerful as a method is
\function
{
degrees()
}
.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment