今天是一个大喜的日子,因为在今天又有亿个人出生了……
Ou NO,别打脸……
言归正传,海龟先生给大家跳了一段海草舞。
效果图好像一顶绿帽子……
源代码import turtle as t
import random
tw = []
def c_t(n):
for i in range(n):
a = t.Turtle()
a.shape("turtle")
a.speed(0)
a.color("green")
a.penup()
tw.append(a)
def m_t_s(n,d):
x = -d * (n - 1) / 2
y = 0
for da in tw:
da.goto(x,y)
da.right(90)
x += d
num = 9
dis = 100
c_t(num)
m_t_s(num,dis)
hi = [0,60,90,60,0,-60,-90,-60,0]
while True:
for i in range(len(hi)):
tt = tw[i]
tt.sety(hi[i])
hi.append(hi.pop(0))
拜拜了您嘞。。。。



