Commit 89d16e3b by BellCodeEditor

auto save

parent e1f2c52d
Showing with 50 additions and 14 deletions
player=input("请出拳:(石头/剪刀/布)")# 玩家出拳
print("玩家出拳:"+player)
import random
list=["石头","剪刀","布"]
computer=random.choice(list)
print("电脑出拳"+computer)
if player in list:
if player==computer:
print("平局")
elif (player=="石头"and computer=="剪刀")or(player=="剪刀"and computer=="布")or(player=="布"and computer=="石头"):
print("恭喜,你赢了")
else: print("很遗憾,你输了")
good=0
a=input("一还是二?(请打汉字~)")
print("本次石头剪刀布比赛采用回合制,共五次,三局两胜制")
print("————————————————————————————————————————————————")
for i in range(5):
if a=="一":
player=input("请出拳:(石头/剪刀/布)")# 玩家出拳
print("玩家出拳:"+player)
import random
list=["石头","剪刀","布"]
computer=random.choice(list)
print("电脑出拳:"+computer)
if player in list:
if player==computer:
print("本次结果:平局")
elif (player=="石头"and computer=="剪刀")or(player=="剪刀"and computer=="布")or(player=="布"and computer=="石头"):
print("本次结果:恭喜,你赢了")
good=good+1
else: print("本次结果:很遗憾,你输了")
else:
print("输入错误")
elif a=="二":
player=input("请出拳:(石头/剪刀/布)")# 玩家出拳
print("玩家出拳:"+player)
if player=="石头":
computer="剪刀"
if player=="剪刀":
computer="布"
if player=="布":
computer="石头"
print("电脑出拳:"+computer)
if (player=="剪刀")or(player=="石头")or(player=="布"):
if player==computer:
print("本次结果:平局")
elif (player=="石头"and computer=="剪刀")or(player=="剪刀"and computer=="布")or(player=="布"and computer=="石头"):
print("本次结果:恭喜,你赢了")
good=good+1
else: print("本次结果:很遗憾,你输了")
else:
print("输入错误")
else:
print("请重新选择")
if good>2:
print("比赛结果:恭喜你,取得了比赛的胜利")
elif good<3:
print("比赛结果:很遗憾,你没有获得胜利,请再接再厉")
else:
print("输入错误")
\ No newline at end of file
print("请检查输入")
#石头剪刀布,输入石头,剪刀,布与人工智能进行石头剪刀布,采用五局三胜制。
#一是普通模式,二是作弊模式。
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment