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

Function main

Lib/turtledemo/round_dance.py:26–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

24 running = False
25
26def main():
27 global running
28 clearscreen()
29 bgcolor("gray10")
30 tracer(False)
31 shape("triangle")
32 f = 0.793402
33 phi = 9.064678
34 s = 5
35 c = 1
36 # create compound shape
37 sh = Shape("compound")
38 for i in range(10):
39 shapesize(s)
40 p =get_shapepoly()
41 s *= f
42 c *= f
43 tilt(-phi)
44 sh.addcomponent(p, (c, 0.25, 1-c), "black")
45 register_shape("multitri", sh)
46 # create dancers
47 shapesize(1)
48 shape("multitri")
49 pu()
50 setpos(0, -200)
51 dancers = []
52 for i in range(180):
53 fd(7)
54 tilt(-4)
55 lt(2)
56 update()
57 if i % 12 == 0:
58 dancers.append(clone())
59 home()
60 # dance
61 running = True
62 onkeypress(stop)
63 listen()
64 cs = 1
65 while running:
66 ta = -4
67 for dancer in dancers:
68 dancer.fd(7)
69 dancer.lt(2)
70 dancer.tilt(ta)
71 ta = -4 if ta > 0 else 2
72 if cs < 180:
73 right(4)
74 shapesize(cs)
75 cs *= 1.005
76 update()
77 return "DONE!"
78
79if __name__=='__main__':
80 print(main())

Callers 1

round_dance.pyFile · 0.70

Calls 13

addcomponentMethod · 0.95
tracerFunction · 0.85
ShapeClass · 0.85
puFunction · 0.85
fdFunction · 0.85
updateFunction · 0.85
homeClass · 0.85
listenFunction · 0.85
rightClass · 0.85
ltMethod · 0.80
tiltMethod · 0.80
ltFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…