Commit 8afd2f9c by BellCodeEditor

save project

parent f90052c3
Showing with 9 additions and 24 deletions
......@@ -5,33 +5,18 @@ p.color('sienna')
p.lt(90)
# 画布大小
w = turtle.Screen()
w.bgcolor('wheat')
w.bgcolor('wheat') # wheat小麦
def tree(n):
if n>=0:
a=random.randint(0,30)
c=random.randint(1,15)
if n<=12:
colorlist=["snow","lightcoral"]
color=random.choice(colorlist)
p.pencolor(color)
p.pensize(n/3)
else:
p.pencolor("sienna")
p.pensize(n/10)
if n>=50:
p.fd(n)
p.right(a)
tree(n-c)
p.left(2*a)
tree(n-c)
p.right(a)
angel
p.rt(30)
tree(n-50)
p.left(60)
tree(n-50)
p.right(30)
p.up()
p.bk(n)
p.down()
p.up()
p.bk(200)
p.down()
tree(60)
tree(100)
turtle.done()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment