Commit 3a425c4c by BellCodeEditor

save project

parent 5f68184e
Showing with 8 additions and 4 deletions
......@@ -3,12 +3,15 @@ import random
def tree(n):
if n>=0:
pen.pensize(n/10)
pen.forward(n)
pen.right(30)
a=random.randint(0,30)
l=random.randint(1,15)
pen.right(a)
tree(n-l)
pen.left(a*2)
tree(n-10)
pen.left(60)
tree(n-10)
pen.right(30)
pen.right(a)
pen.up()
pen.backward(n)
pen.down()
......@@ -19,6 +22,7 @@ pen.color('sienna')
w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦
speed=30
# 移动到起点
pen.left(90)
pen.up()
......
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