Back to index

python3.2  3.2.2
Functions | Variables
turtledemo.tree Namespace Reference

Functions

def tree
def maketree
def main

Variables

tuple msg = main()

Function Documentation

Definition at line 54 of file tree.py.

00054 
00055 def main():
00056     a=clock()
00057     maketree()
00058     b=clock()
00059     return "done: %.2f sec." % (b-a)

Here is the call graph for this function:

Definition at line 39 of file tree.py.

00039 
00040 def maketree():
00041     p = Turtle()
00042     p.setundobuffer(None)
00043     p.hideturtle()
00044     p.speed(0)
00045     p.getscreen().tracer(30,0)
00046     p.left(90)
00047     p.penup()
00048     p.forward(-210)
00049     p.pendown()
00050     t = tree([p], 200, 65, 0.6375)
00051     for x in t:
00052         pass
00053     print(len(p.getscreen().turtles()))

Here is the call graph for this function:

Here is the caller graph for this function:

def turtledemo.tree.tree (   plist,
  l,
  a,
  f 
)
plist is list of pens
l is length of branch
a is half of the angle between 2 branches
f is factor by which branch is shortened
from level to level.

Definition at line 21 of file tree.py.

00021 
00022 def tree(plist, l, a, f):
00023     """ plist is list of pens
00024     l is length of branch
00025     a is half of the angle between 2 branches
00026     f is factor by which branch is shortened
00027     from level to level."""
00028     if l > 3:
00029         lst = []
00030         for p in plist:
00031             p.forward(l)
00032             q = p.clone()
00033             p.left(a)
00034             q.right(a)
00035             lst.append(p)
00036             lst.append(q)
00037         for x in tree(lst, l*f, a, f):
00038             yield None

Here is the caller graph for this function:


Variable Documentation

Definition at line 61 of file tree.py.