Commit f2e6d1d1 by BellCodeEditor

auto save

parent fa8a201a
Showing with 16 additions and 12 deletions
import random import random
a=input("请输入你要出的:") while True:
print("玩家:"+a) a=input("请输入你要出的(剪刀/石头/布):")
list=["石头","布","剪刀"] if a=="石头" or a=="剪刀" or a=="布":
b = random.choice(list) print("玩家:"+a)
print("人机:"+b) list=["石头","布","剪刀"]
if a==b: b = random.choice(list)
print("平局") print("人机:"+b)
elif (a=="剪刀" and b=="布") or (a=="石头" and b=="剪刀") or (a=="布" and b=="石头"): if a==b:
print("玩家胜利") print("平局")
else: elif (a=="剪刀" and b=="布") or (a=="石头" and b=="剪刀") or (a=="布" and b=="石头"):
print("人机胜利") print("玩家胜利")
\ No newline at end of file else:
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