MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / test

Function test

tools/python-3.11.9-amd64/Lib/turtledemo/penrose.py:135–146  ·  view source on GitHub ↗
(l=200, n=4, fun=sun, startpos=(0,0), th=2)

Source from the content-addressed store, hash-verified

133 resizemode("user")
134
135def test(l=200, n=4, fun=sun, startpos=(0,0), th=2):
136 global tiledict
137 goto(startpos)
138 setheading(0)
139 tiledict = {}
140 tracer(0)
141 fun(l, n)
142 draw(l, n, th)
143 tracer(1)
144 nk = len([x for x in tiledict if tiledict[x]])
145 nd = len([x for x in tiledict if not tiledict[x]])
146 print("%d kites and %d darts = %d pieces." % (nk, nd, nk+nd))
147
148def demo(fun=sun):
149 start()

Callers 2

demoFunction · 0.70
mainFunction · 0.70

Calls 2

drawFunction · 0.70
printFunction · 0.50

Tested by

no test coverage detected