Back to index

python3.2  3.2.2
Classes | Functions | Variables
turtledemo.fractalcurves Namespace Reference

Classes

class  CurvesTurtle

Functions

def main

Variables

tuple msg = main()

Function Documentation

Definition at line 78 of file fractalcurves.py.

00078 
00079 def main():
00080     ft = CurvesTurtle()
00081 
00082     ft.reset()
00083     ft.speed(0)
00084     ft.ht()
00085     ft.getscreen().tracer(1,0)
00086     ft.pu()
00087 
00088     size = 6
00089     ft.setpos(-33*size, -32*size)
00090     ft.pd()
00091 
00092     ta=clock()
00093     ft.fillcolor("red")
00094     ft.begin_fill()
00095     ft.fd(size)
00096 
00097     ft.hilbert(size, 6, 1)
00098 
00099     # frame
00100     ft.fd(size)
00101     for i in range(3):
00102         ft.lt(90)
00103         ft.fd(size*(64+i%2))
00104     ft.pu()
00105     for i in range(2):
00106         ft.fd(size)
00107         ft.rt(90)
00108     ft.pd()
00109     for i in range(4):
00110         ft.fd(size*(66+i%2))
00111         ft.rt(90)
00112     ft.end_fill()
00113     tb=clock()
00114     res =  "Hilbert: %.2fsec. " % (tb-ta)
00115 
00116     sleep(3)
00117 
00118     ft.reset()
00119     ft.speed(0)
00120     ft.ht()
00121     ft.getscreen().tracer(1,0)
00122 
00123     ta=clock()
00124     ft.color("black", "blue")
00125     ft.begin_fill()
00126     ft.fractalgon(3, 250, 4, 1)
00127     ft.end_fill()
00128     ft.begin_fill()
00129     ft.color("red")
00130     ft.fractalgon(3, 200, 4, -1)
00131     ft.end_fill()
00132     tb=clock()
00133     res +=  "Koch: %.2fsec." % (tb-ta)
00134     return res


Variable Documentation

Definition at line 136 of file fractalcurves.py.