Commit 13ca40fb by BellCodeEditor

save project

parent ab1fe2f7
Showing with 37 additions and 17 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
print("平局") lis=["石头","剪刀","布"]
elif player=="石头" and computer=="剪刀": if player in lis:
print("你赢了") computer=random.choice(lis)
elif player=="剪刀" and computer=="布": print("电脑出拳:"+computer)
print("你赢了") if player==computer:
elif player==("布") and computer=="石头": print("平局")
print("你赢了") elif player=="石头" and computer=="剪刀":
print("你赢了")
score=score+1
elif player=="剪刀" and computer=="布":
print("你赢了")
score=score+1
elif player==("布") and computer=="石头":
print("你赢了")
score=score+1
else:
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: else:
print("你输了") print("----你输了----")
\ No newline at end of file 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