用户:
友善的胆小菇MPaq查看:0 回复:2 评论:0 创建时间:2022-10-05T17:31:33
【作品展示】

【作品介绍】
无
【作品源代码】
import string
import random
wd = []
cs = 5
喵 = False
gs = 1
while True:
if 喵:
break
print("第"+str(gs)+"关")
a = list(string.ascii_lowercase)
if gs==1:
for i in range(21):
a.pop()
l = []
for i in range(cs):
z = random.choice(a)
for i in range(3):
l.append(z)
xy = []
for i in range(8):
if len(l) > 0:
z = random.choice(l)
xy.append(z)
l.pop(l.index(z))
while True:
print("请选择", xy)
print("槽位", wd)
a = input()
if a not in xy:
print("输入错误,请重新输入")
else:
if len(l) > 0:
b = random.choice(l)
xy[xy.index(a)] = b
l.pop(l.index(b))
else:
xy.pop(xy.index(a))
wd.append(a)
for i in wd:
a = wd.count(i)
if a == 3:
for j in range(3):
wd.pop(wd.index(i))
print("--------------------------------------------")
if len(xy) == 0:
print("下一关,难度飙升")
gs += 1
cs += 5
break
if len(wd) == 7:
print("槽位已满")
喵 = True
break
【提示】
部分含有Python第三方库相关内容的作品,在海龟编辑器网页端无法运行哦!如遇到这种情况,可以打开下面的链接,下载海龟编辑器客户端:
https://python.codemao.cn