Commit 8afd2f9c by BellCodeEditor

save project

parent f90052c3
Showing with 9 additions and 24 deletions
...@@ -5,33 +5,18 @@ p.color('sienna') ...@@ -5,33 +5,18 @@ p.color('sienna')
p.lt(90) p.lt(90)
# 画布大小 # 画布大小
w = turtle.Screen() w = turtle.Screen()
w.bgcolor('wheat') w.bgcolor('wheat') # wheat小麦
def tree(n): def tree(n):
if n>=0: if n>=50:
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)
p.fd(n) p.fd(n)
p.right(a) angel
tree(n-c) p.rt(30)
p.left(2*a) tree(n-50)
tree(n-c) p.left(60)
p.right(a) tree(n-50)
p.right(30)
p.up() p.up()
p.bk(n) p.bk(n)
p.down() p.down()
p.up() tree(100)
p.bk(200)
p.down()
tree(60)
turtle.done() 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