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()
pen.color('sienna')
# 画布大小
w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦
def tree(n):
if n>=50:
forward(n)
right(30)
tree(n-10)
left(60)
tree(n-10)
right(30)
up()
backward(n)
down()
# 移动到起点
pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
tree(100)
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