猫史档案馆


【Python作品分享】狼人殺【作品秀】

用户:屑雷神索尔屑雷神索尔查看:0 回复:1 评论:0 创建时间:2019-09-21T22:05:13


【作品展示】

center_image

 

【作品介绍】

狼人殺五人版!不喜自噴!

 

【作品源代码】

import random
import time
import os
charctors=['狼人','巫女','平民','平民','狼人']
charctors1={}
is_alive=[0,0,0,0,0]
for a in range(1,6):
    ran=random.randint(0,5-a)
    charctors1[str(a)]=charctors[ran]
    charctors.pop(ran)
for a in charctors1:
    print(a,charctors1[a])
    time.sleep(5)
    os.system('cls')
for b in range(2):
    print('天黑請閉眼')
    time.sleep(1)
    os.system('cls')
    print('狼人請睜眼')
    time.sleep(1)
    os.system('cls')
    for a in range(2):
        a=int(input('你要殺誰?'))
        is_alive[a]=1
        time.sleep(1)
        os.system('cls')
    print('狼人請閉眼')
    time.sleep(1)
    os.system('cls')
    print('巫女請睜眼')
    a=int(input('你要救誰?'))
    is_alive[a]=0
    time.sleep(1)
    os.system('cls')
    print('巫女請閉眼')
    time.sleep(1)
    os.system('cls')

print('天亮了,請睜眼')
for a in range(5):
    if is_alive[a]==0:
        print(a+1,'活了下來')
    else:
        print(a+1,'喵了')
time.sleep(3)


 

【提示】

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

https://python.codemao.cn


回复

上一页1 页 / 共 1下一页
梦里觅深海梦里觅深海

我去试下

点赞0


评论