Commit b85f8dc1 by BellCodeEditor

auto save

parent f3477d6e
Showing with 4 additions and 3 deletions
import turtle
import random
pen = turtle.Turtle()
pen.color('sienna')
# 画布大小
......@@ -16,8 +15,10 @@ pen.down()
def tree(n):
if n >=50:
pen.size(n/10)
pen.forward(n)
angle=random.randint(0,30)
length=random.randint(1,15)
pen.right(30)
tree(n-10)
pen.left(60)
......@@ -26,7 +27,7 @@ def tree(n):
pen.up()
pen.backward(n)
pen.down()
pen.speed(100)
pen.speed(500)
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