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

Function tree

Lib/turtledemo/forest.py:27–48  ·  view source on GitHub ↗
(tlist, size, level, widthfactor, branchlists, angledist=10, sizedist=5)

Source from the content-addressed store, hash-verified

25 t.forward( (1.0 * distance)/parts )
26
27def tree(tlist, size, level, widthfactor, branchlists, angledist=10, sizedist=5):
28 # benutzt Liste von turtles und Liste von Zweiglisten,
29 # fuer jede turtle eine!
30 if level > 0:
31 lst = []
32 brs = []
33 for t, branchlist in list(zip(tlist,branchlists)):
34 t.pensize( size * widthfactor )
35 t.pencolor( 255 - (180 - 11 * level + symRandom(15)),
36 180 - 11 * level + symRandom(15),
37 0 )
38 t.pendown()
39 randomfd(t, size, level, angledist )
40 yield 1
41 for angle, sizefactor in branchlist:
42 t.left(angle)
43 lst.append(t.clone())
44 brs.append(randomize(branchlist, angledist, sizedist))
45 t.right(angle)
46 for x in tree(lst, size*sizefactor, level-1, widthfactor, brs,
47 angledist, sizedist):
48 yield None
49
50
51def start(t,x,y):

Callers 3

doit1Function · 0.70
doit2Function · 0.70
doit3Function · 0.70

Calls 11

listClass · 0.85
symRandomFunction · 0.85
randomfdFunction · 0.85
pensizeMethod · 0.80
pencolorMethod · 0.80
pendownMethod · 0.80
leftMethod · 0.80
rightMethod · 0.80
randomizeFunction · 0.70
appendMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…