猫史档案馆


python作品

用户:勤奋的程序喵勤奋的程序喵查看:0 回复:0 评论:0 创建时间:2023-08-04T14:44:50


 

import turtle as t
import random
import time
t.speed(100)
nu=1
xy=[]
t.pencolor('#829')
t.pensize(4)
for __count in range(18):
    xy.append(0)
def draw(nu):
    nu=nu
    t.pendown()
    for __count in range(4):
        xy[nu]=t.xcor()
        xy[(nu+1)]=t.ycor()
        nu +=2
        t.forward(100)
        t.left(90)
def over():
    c=1
    for __count in range(4):
        t.goto(xy[c],xy[(c+1)])
        t.pendown()
        t.goto(xy[(c+8)],xy[(c+9)])
        t.penup()
        c +=2
while True:
    t.penup()
    t.goto(random.randint(1,200),random.randint(1,200))
    t.pendown()
    draw(1)
    t.penup()
    t.goto(random.randint(1,200),random.randint(1,200))
    draw(9)
    t.penup()
    over()
    time.sleep((random.randint(1,3))/4)
    t.clear()
t.done()  

 


回复

上一页1 页 / 共 0下一页