Commit e3ce3f8b by BellCodeEditor

save project

parent 5ed7b552
Showing with 4 additions and 3 deletions
......@@ -13,9 +13,10 @@ pen.backward(150) # 后退
pen.down()
def tree(n):
if n>=0:
pen.pensize(n/10)snow,lightcoral
pen.forward(n)
angle=random.randint(1,30)
long=random.randint(1,15)
angle=random.randint(10,30)
long=random.randint(1,20)
pen.right(angle)
tree(n-long)
pen.left(2*angle)
......@@ -25,5 +26,5 @@ def tree(n):
pen.backward(n)
pen.pendown()
pen.speed(0)
tree(60)
tree(70)
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