Commit 13ca40fb by BellCodeEditor

save project

parent ab1fe2f7
Showing with 33 additions and 12 deletions
# 玩家出拳 # 玩家出拳
player=input("请出拳:")
print("玩家出拳:"+player) score=0
import random computer_score=0
lis=["石头","剪刀","布"] for i in range(6):
computer=random.choice(lis) player=input("请出拳:")
print("电脑出拳:"+computer) print("玩家出拳:"+player)
if player==computer: import random
lis=["石头","剪刀","布"]
if player in lis:
computer=random.choice(lis)
print("电脑出拳:"+computer)
if player==computer:
print("平局") print("平局")
elif player=="石头" and computer=="剪刀": elif player=="石头" and computer=="剪刀":
print("你赢了") print("你赢了")
elif player=="剪刀" and computer=="布": score=score+1
elif player=="剪刀" and computer=="布":
print("你赢了") print("你赢了")
elif player==("布") and computer=="石头": score=score+1
elif player==("布") and computer=="石头":
print("你赢了") print("你赢了")
else: score=score+1
else:
print("你输了") print("你输了")
computer_score=computer_score+1
else:
print("----说人话----")
score=score-1
print("你的分数:",score)
print("电脑分数:",computer_score)
if score==computer_score:
print("----平局----")
elif score>computer_score:
print("----你赢了----")
else:
print("----你输了----")
print()
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