Commit 13ca40fb by BellCodeEditor

save project

parent ab1fe2f7
Showing with 37 additions and 17 deletions
# 玩家出拳
player=input("请出拳:")
print("玩家出拳:"+player)
import random
lis=["石头","剪刀","布"]
computer=random.choice(lis)
print("电脑出拳:"+computer)
if player==computer:
print("平局")
elif player=="石头" and computer=="剪刀":
print("你赢了")
elif player=="剪刀" and computer=="布":
print("你赢了")
elif player==("布") and computer=="石头":
print("你赢了")
# 玩家出拳
score=0
computer_score=0
for i in range(6):
player=input("请出拳:")
print("玩家出拳:"+player)
import random
lis=["石头","剪刀","布"]
if player in lis:
computer=random.choice(lis)
print("电脑出拳:"+computer)
if player==computer:
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:
print("你输了")
\ No newline at end of file
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