Commit 059e2d11 by BellCodeEditor

save project

parent 57019a46
Showing with 15 additions and 1 deletions
...@@ -4,7 +4,18 @@ pen = turtle.Turtle() ...@@ -4,7 +4,18 @@ pen = turtle.Turtle()
pen.color('sienna') pen.color('sienna')
# 画布大小 # 画布大小
w = turtle.Screen() w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦 w.bgcolor('wheat')
def tree(n):
if n>=50:
pen. forward(n)
pen.right(30)
tree(n-10)
pen.up()
pen.left(60)
pen.backward(n)
pen.down()
# wheat小麦
# 移动到起点 # 移动到起点
pen.left(90) pen.left(90)
...@@ -26,3 +37,6 @@ turtle.right(30) ...@@ -26,3 +37,6 @@ turtle.right(30)
turtle.forward(-100) turtle.forward(-100)
turtle.done() turtle.done()
tree(100)
turtle.down()
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