Commit 993388f7 by BellCodeEditor

save project

parent f781ae2d
Showing with 11 additions and 7 deletions
# 玩家出拳 # 玩家出拳
was = input("请输入你的手势,石头、剪刀、布:")
print("玩家出拳," + was)
rtwg = ["石头","剪刀","布"] rtwg = ["石头","剪刀","布"]
import random import random
wsa = random.choice(rtwg) was = input("请输入你的手势,石头、剪刀、布:")
print("计算机出拳," + wsa) if was in rtwg:
if was == wsa: print("玩家出拳," + was)
wsa = random.choice(rtwg)
print("计算机出拳," + wsa)
if was == wsa:
print("平局") print("平局")
elif (was == "剪刀" and wsa == "布") or (was == "石头" and wsa == "剪刀") or (was == "布" and wsa == "石头"): elif (was == "剪刀" and wsa == "布") or (was == "石头" and wsa == "剪刀") or (was == "布" and wsa == "石头"):
print("玩家胜利") print("玩家胜利")
else: else:
print("玩家失败") print("玩家失败")
else:
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