|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
#斗地主积分赛小程序
dict1={}
dict1 = dict1.fromkeys(range(1,7),100)
f = int(input("请输入本轮想打的盘数"))
number = 0
while number < f:
d = input("是否加倍或超级加倍?")
if d == "否":
e = 1
elif d == "加倍":
e = 2
else:
e = 3
if e == 1:
winner=input("赢家是地主还是平民?")
if winner == "平民":
a = int(input("请输入炸的数量(王炸算两个炸):"))
score = (a+1)*5
dizhu= int(input("请输入地主的编号:"))
dict1[dizhu] = dict1[dizhu] - score
pingmin1= int(input("请输入平民1的编号:"))
dict1[pingmin1] = dict1[pingmin1] + (score/2)
pingmin2= int(input("请输入平民2的编号:"))
dict1[pingmin2] = dict1[pingmin2] + (score/2)
else:
a = int(input("请输入炸的数量(王炸算两个炸):"))
score = (a+1)*5
dizhu= int(input("请输入地主的编号:"))
dict1[dizhu] = dict1[dizhu] + score
pingmin1= int(input("请输入平民1的编号:"))
dict1[pingmin1] = dict1[pingmin1] - (score/2)
pingmin2= int(input("请输入平民2的编号:"))
dict1[pingmin2] = dict1[pingmin2] - (score/2)
if e == 2:
winner=input("赢家是地主还是平民?")
if winner == "平民":
a = int(input("请输入炸的数量(王炸算两个炸):"))
score = (a+2)*5
dizhu= int(input("请输入地主的编号:"))
dict1[dizhu] = dict1[dizhu] - score
pingmin1= int(input("请输入平民1的编号:"))
dict1[pingmin1] = dict1[pingmin1] + (score/2)
pingmin2= int(input("请输入平民2的编号:"))
dict1[pingmin2] = dict1[pingmin2] + (score/2)
else:
a = int(input("请输入炸的数量(王炸算两个炸):"))
score = (a+2)*5
dizhu= int(input("请输入地主的编号:"))
dict1[dizhu] = dict1[dizhu] + score
pingmin1= int(input("请输入平民1的编号:"))
dict1[pingmin1] = dict1[pingmin1] - (score/2)
pingmin2= int(input("请输入平民2的编号:"))
dict1[pingmin2] = dict1[pingmin2] - (score/2)
if e == 3:
winner=input("赢家是地主还是平民?")
if winner == "平民":
a = int(input("请输入炸的数量(王炸算两个炸):"))
score = (a+3)*5
dizhu= int(input("请输入地主的编号:"))
dict1[dizhu] = dict1[dizhu] - score
pingmin1= int(input("请输入平民1的编号:"))
dict1[pingmin1] = dict1[pingmin1] + (score/2)
pingmin2= int(input("请输入平民2的编号:"))
dict1[pingmin2] = dict1[pingmin2] + (score/2)
else:
a = int(input("请输入炸的数量(王炸算两个炸):"))
score = (a+3)*5
dizhu= int(input("请输入地主的编号:"))
dict1[dizhu] = dict1[dizhu] + score
pingmin1= int(input("请输入平民1的编号:"))
dict1[pingmin1] = dict1[pingmin1] - (score/2)
pingmin2= int(input("请输入平民2的编号:"))
dict1[pingmin2] = dict1[pingmin2] - (score/2)
number += 1
for i in dict1.items():
print(i)
continue
|
|