Commit 95e68e3a by BellCodeEditor

save project

parent 299cc177
Showing with 16 additions and 10 deletions
...@@ -9,15 +9,21 @@ w.bgcolor('wheat') # wheat小麦 ...@@ -9,15 +9,21 @@ w.bgcolor('wheat') # wheat小麦
# 移动到起点 # 移动到起点
pen.left(90) pen.left(90)
pen.up() pen.up()
pen.backward(150) # 后退 pen.backward(200)
pen.down() pen.down()
pen.forward(100) def tree(n):
pen.right(30) if n >=50:
pen.forward(50) pen.forward(n)
pen.backward(50) pen.right(30)
pen.left(60) tree(n-10)
pen.forward(50) pen.left(60)
pen.backward(50) tree(n-10)
pen.right(30) pen.right(30)
pen.backward(100) pen.up()
pen.backward(n)
pen.down()
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