Commit d79d939c by BellCodeEditor

save project

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