Commit 79c01ded by BellCodeEditor

save project

parent bc25ba97
Showing with 16 additions and 12 deletions
...@@ -5,17 +5,21 @@ pen.color('sienna') ...@@ -5,17 +5,21 @@ pen.color('sienna')
# 画布大小 # 画布大小
w = turtle.Screen() w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦 w.bgcolor('wheat') # wheat小麦
pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
pen.forward(150)
# 移动到起点
def tree(a): def tree(a):
if a>=50: if a>=50:
pen.forward(a)
pen.forward(a) pen.right(30)
pen.backward(a) tree(a-50)
pen.left(60) pen.left(60)
tree(a-10) tree(a-50)
pen.forward(a) pen.right(30)
pen.backward(a) pen.backward(a)
pen.right(30) return(a)
tree(a-10) tree(150)
pen.backward(a)
tree(100)
turtle.done() 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