Commit d0b539c7 by BellCodeEditor

save project

parent 576b5884
Showing with 30 additions and 0 deletions
import turtle
import random
t = turtle.Turtle()
t.color('sienna')
# 画布大小
w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦
# 移动到起点
t.left(90)
t.up()
t.backward(150) # 后退
t.down()
def shu(n):
if n >= 50:
t.forward(n)
jiao=random.randint(0,30)
chang=random.randint(1,15)
t.right(jiao)
shu(n-10)
t.left(2*jiao)
shu(n-10)
t.right(jiao)
t.penup()
t.backward(n)
t.pendown()
shu(100)
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