Commit 7d94c028 by BellCodeEditor

save project

parent 3696abd1
Showing with 18 additions and 13 deletions
import turtle
import random
pen = turtle.Turtle()
pen.color('sienna')
# 画布大小
w = turtle.Screen()
w.bgcolor('wheat') # wheat小麦
# 移动到起点
pen.left(90)
pen.up()
pen.backward(150) # 后退
pen.down()
pen.forward(100)
pen.right(30)
pen.forward(50)
pen.up()
pen.backward(50)
pen.backward(150)
pen.down()
pen.left(60)
pen.forward(50)
turtle.done()
# 移动到起点
def c(n):
if n>=50:
a=random.randint(0,30)
b=random.randint(0,15)
pen.forward(n)
pen.right(a)
c(n-b)
pen.left(a*2)
c(n-b)
pen.up()
pen.right(a)
pen.backward(n)
pen.down()
c(100)
\ No newline at end of file
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