Commit 988d0067 by BellCodeEditor

save project

parent b2294df3
Showing with 21 additions and 16 deletions
# 玩家出拳 # 玩家出拳
a=input("你出什么?(石头/剪刀/布)") import random
print("玩家出拳:"+a) c=0
import ramdom for i in range(5):
list=["剪刀","石头","布"] a=input("你出什么?(石头/剪刀/布)")
b=ramdom.choice(list) print("玩家出拳:"+a)
print("机器出拳"+b) list=["剪刀","石头","布"]
if a in list: b=random.choice(list)
if a==b: print("机器出拳"+b)
print("平局")
elif (a=="布" and b=="石头") or (a=="石头" and b=="剪刀") or (a=="剪刀" and b=="布"): if a in list:
print("赢了") if a==b:
print("平局")
elif (a=="布" and b=="石头") or (a=="石头" and b=="剪刀") or (a=="剪刀" and b=="布"):
print("赢了")
c+=1
else:
print("输了")
else: else:
print("输了") print("输错了")
print("你赢了"+str(c)+"次")
else: \ No newline at end of file
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