Commit ed786854 by BellCodeEditor

auto save

parent 3e18b465
Showing with 22 additions and 12 deletions
import turtle
pen = turtle.Turtle()
pen.color('sienna')
# 画布大小
w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦
import turtle,random
t = turtle.Pen()
t.color('sienna')
sc = turtle.Screen()
sc.bgcolor('wheat') # wheat小麦
# 移动到起点
pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
t.setheading(90)
t.up()
t.backward(150) # 后退
t.down()
t.speed(0)
def tree(n):
if n>=0:
t.forward(n)
t.right(angle)
tree(n-length)
t.left(angle*2)
tree(n-length)
t.right(angle)
t.up()
t.backward(n)
t.down()
tree(60)
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