Commit 7201004e by BellCodeEditor

save project

parent 5f57f2b2
Showing with 18 additions and 8 deletions
import random import random
xxx=input("出拳:") sum=0
print("玩家出拳是:"+xxx) while True :
x=["剪刀","石头","布"] xxx=input("出拳:")
xx=random.choice(x) print("玩家出拳是:"+xxx)
print(xx) x=["剪刀","石头","布"]
if xxx==xx: xx=random.choice(x)
print(xx)
if xxx in x:
if xxx==xx:
print("平局") print("平局")
elif (xxx=="石头"and xx=="剪刀") or (xxx=="剪刀"and xx=="布") or (xxx=="布"and xx=="石头") : elif (xxx=="石头"and xx=="剪刀") or (xxx=="剪刀"and xx=="布") or (xxx=="布"and xx=="石头") :
print("我赢了") print("我赢了")
else : sum=sum+1
print("我赢了:",sum,"局")
if sum==5:
break
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