Commit 1146f561 by BellCodeEditor

save project

parent a21fb048
Showing with 19 additions and 8 deletions
......@@ -5,23 +5,34 @@ pen.color('sienna')
# 画布大小
w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦
# 移动到起点
pen.speed(100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)
pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
def p(l):
if l>=50:
if l>=0:
pen.pensize(l/10)
pen.forward(l)
pen.right(30)
p(l-random.randint(5,10))
ag = random.randint(0,30)
lth = random.randint(1,15)
pen.right(ag)
p(l-lth)
pen.up()
pen.down()
pen.left(60)
p(l-random.randint(5,10))
pen.left(2*ag)
p(l-lth)
pen.up()
pen.right(30)
pen.right(ag)
pen.backward(l)
p(random.randint(50,100))
if l<=12:
list = ['snow','lightcoral']
a = random.choice(list)
pen.color(a)
pen.pensize(l/3)
else:
pen.color('sienna')
pen.pensize(l/10)
p(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