Commit 8b705ee5 by BellCodeEditor

save project

parent a075876f
Showing with 14 additions and 1 deletions
import turtle
import random
def tree(n):
if n >= 50:
pen.forward(n)
a = random.randint(0,30)
pen.right(a)
tree(n-10)
pen.left(2*a)
tree(n-10)
pen.right(a)
pen.up()
pen.backward(n)
pen.down()
pen = turtle.Turtle()
pen.color('sienna')
......@@ -11,5 +24,5 @@ pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
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