Commit b3d695f9 by BellCodeEditor

auto save

parent 6e32bae3
Showing with 18 additions and 17 deletions
......@@ -12,27 +12,28 @@ pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
def tree(n):
if n>=50:
if n>=0:
if n <= 12:
color_list=["snow","lightcoral"]
color=random.choice(color_list)
pen.pencolor(color)
pen.pensize(n/3)
else:
pen.pencolor("sienna")
pen.pensize(n/10)
angle=random.randint(1,15)
length=random.randint(0,15)
pen.forward(n)
pen.right(30)
tree(n-10)
pen.left(60)
tree(n-10)
pen.right(30)
pen.right(angle)
tree(n-length)
pen.left(angle*2)
tree(n-length)
pen.right(angle)
pen.up()
pen.backward(n)
pen.down()
tree(100)
# pen.fd(100)
# pen.right(30)
# pen.fd(50)
# pen.backward(50)
# pen.left(60)
# pen.fd(50)
# pen.up()
# pen.backward(50)
# pen.right(30)
# pen.backward(100)
tree(60)
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