Commit d68fed74 by BellCodeEditor

auto save

parent 6ab4ce35
Showing with 45 additions and 5 deletions
import random
num=0
while True:
a=input("请玩家出拳(石头/剪刀/布)")
list=["石头","剪刀","布"]
b=input("请另一个玩家出拳(石头/剪刀/布)")
if a in list:
if a==b:
print("平局")
elif(a=="石头"and b=="剪刀")or(a=="剪刀"and b=="布")or(a=="布"and b=="石头"):
print("赢了")
num=num+1
print("您赢了",num,"次")
if num==3:
print("完胜")
break
else:
print("输了")
num=0
else:
print("输入错误,重新输入")
\ No newline at end of file
# 玩家出拳
import random
a=input("请玩家出拳(石头/剪刀/布)")
print("玩家出拳:"+a)
list=["石头","剪刀","布"]
b=random.choice(list)
print(b)
num=0
while True:
a=input("请玩家出拳(石头/剪刀/布)")
print("玩家出拳:"+a)
list=["石头","剪刀","布"]
b=random.choice(list)
print(b)
if a in list:
if a==b:
print("平局")
elif(a=="石头"and b=="剪刀")or(a=="剪刀"and b=="布")or(a=="布"and b=="石头"):
print("赢了")
num=num+1
print("您赢了",num,"次")
if num==3:
print("完胜")
break
else:
print("输了")
num=0
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