Commit 9c49ab2a by BellCodeEditor

save project

parent d0b539c7
Showing with 15 additions and 5 deletions
...@@ -8,23 +8,33 @@ w = turtle.Screen() ...@@ -8,23 +8,33 @@ w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦 w.bgcolor('wheat') # wheat小麦
# 移动到起点 # 移动到起点
t.speed(0)
t.left(90) t.left(90)
t.up() t.up()
t.backward(150) # 后退 t.backward(150) # 后退
t.down() t.down()
def shu(n): def shu(n):
if n >= 50: if n >= 0:
if n<=12:
li=['snow','lightcoral']
se=random.choice(li)
t.color(se)
t.pensize(n/3)
else:
t.color('sienna')
t.pensize(n/10)
t.pensize(n/10)
t.forward(n) t.forward(n)
jiao=random.randint(0,30) jiao=random.randint(0,30)
chang=random.randint(1,15) chang=random.randint(5,15)
t.right(jiao) t.right(jiao)
shu(n-10) shu(n-chang)
t.left(2*jiao) t.left(2*jiao)
shu(n-10) shu(n-chang)
t.right(jiao) t.right(jiao)
t.penup() t.penup()
t.backward(n) t.backward(n)
t.pendown() t.pendown()
shu(100) shu(80)
turtle.done() 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