Commit 78e95eb8 by BellCodeEditor

auto save

parent 814b8f0f
Showing with 19 additions and 14 deletions
...@@ -6,19 +6,24 @@ pen.color('sienna') ...@@ -6,19 +6,24 @@ pen.color('sienna')
w = turtle.Screen() w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦 w.bgcolor('wheat') # wheat小麦
pen.goto(0,0)# 移动到起点 def tree(n):
pen.left(90) if n>=50:
pen.forward(100) pen.forward(n)
pen.left(30) pen.right(30)
pen.forward(50) tree()
pen.up() # pen.goto(0,0)# 移动到起点
pen.backward(50) # 后退 # pen.left(90)
pen.down() # pen.forward(100)#画树干
pen.right(60) # pen.left(30)
pen.forward(50) # pen.forward(50)#画左边树枝并返回
pen.up() # pen.up()
pen.backward(50) # 后退 # pen.backward(50) # 后退
pen.left(30) # pen.down()
pen.backward(100) # pen.right(60)
# pen.forward(50)#画右边树枝并返回
# pen.up()
# pen.backward(50) # 后退
# pen.left(30)
# pen.backward(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