Commit 8eac1694 by BellCodeEditor

save project

parent a075876f
Showing with 22 additions and 12 deletions
import turtle from turtle import *
color("sienna")
bgcolor("wheat")
left(90)
up()
backward(150)
down()
pen = turtle.Turtle() def tree(n):
pen.color('sienna') if n>=50:
# 画布大小 forward(n)
w = turtle.Screen() right(30)
w.bgcolor('wheat') # wheat小麦 tree(n-10)
left(60)
tree(n-10)
right(30)
up()
backward(n)
down()
# 移动到起点 tree(100)
pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
turtle.done()
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