猫史档案馆


【Python作品分享】12-辨色大师-工程包【教程贴】

用户:螚竜螚竜查看:0 回复:0 评论:0 创建时间:2022-12-08T21:32:43


【作品展示】

center_image

 

【作品介绍】

WDAS

 

【作品源代码】

import turtle as t
import random
import time
from pos import position

t.bgpic('pic.gif')
t.setup(780,520)
t.shape('turtle')
t.shapesize(2)
t.penup()
t.speed(0)

# 请在下方键入本节课代码
j=0.1
level=0
def master():
    global level,j
    r = random.randint(1, 8)/10
    g = random.randint(1, 8)/10
    b = random.randint(1, 8)/10
    t.color(r,g,b)
    position()
    t.color(r+j, g+j, b+j)
    x = random.choice([-80, -25, 25, 80])
    y = random.choice([-80, -25, 25, 80])
    t.goto(x, y)
    level+=1
    j=j-0.005
start = time.time()
while time.time()-start<=10:
    t.onclick(master) 
print("通过了%s关!"%level)

 

【提示】

部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:

https://python.codemao.cn


回复

上一页1 页 / 共 0下一页