MCPcopy Index your code
hub / github.com/python/cpython / main

Function main

Lib/turtledemo/fractalcurves.py:75–130  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73 self.fractal(dist / 3, depth - 1, dir)
74
75def main():
76 ft = CurvesTurtle()
77
78 ft.reset()
79 ft.speed(0)
80 ft.ht()
81 ft.getscreen().tracer(1,0)
82 ft.pu()
83
84 size = 6
85 ft.setpos(-33*size, -32*size)
86 ft.pd()
87
88 ta=clock()
89 ft.fillcolor("red")
90 ft.begin_fill()
91 ft.fd(size)
92
93 ft.hilbert(size, 6, 1)
94
95 # frame
96 ft.fd(size)
97 for i in range(3):
98 ft.lt(90)
99 ft.fd(size*(64+i%2))
100 ft.pu()
101 for i in range(2):
102 ft.fd(size)
103 ft.rt(90)
104 ft.pd()
105 for i in range(4):
106 ft.fd(size*(66+i%2))
107 ft.rt(90)
108 ft.end_fill()
109 tb=clock()
110 res = "Hilbert: %.2fsec. " % (tb-ta)
111
112 sleep(3)
113
114 ft.reset()
115 ft.speed(0)
116 ft.ht()
117 ft.getscreen().tracer(1,0)
118
119 ta=clock()
120 ft.color("black", "blue")
121 ft.begin_fill()
122 ft.fractalgon(3, 250, 4, 1)
123 ft.end_fill()
124 ft.begin_fill()
125 ft.color("red")
126 ft.fractalgon(3, 200, 4, -1)
127 ft.end_fill()
128 tb=clock()
129 res += "Koch: %.2fsec." % (tb-ta)
130 return res
131
132if __name__ == '__main__':

Callers 1

fractalcurves.pyFile · 0.70

Calls 14

hilbertMethod · 0.95
fractalgonMethod · 0.95
CurvesTurtleClass · 0.85
sleepFunction · 0.85
getscreenMethod · 0.80
fillcolorMethod · 0.80
begin_fillMethod · 0.80
ltMethod · 0.80
end_fillMethod · 0.80
resetMethod · 0.45
speedMethod · 0.45
tracerMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…