Commit ce224939 by BellCodeEditor

save project

parent ae2255ef
Showing with 26 additions and 16 deletions
import random
p=input("请出拳(石头,剪刀,布):")
l=["石头","剪刀","布"]
c=random.choice(l)
if p=="石头" or p=="剪刀" or p=="布":
print("玩家1出了",p)
print("玩家2出了",c)
if p==c:
print("双方平局")
elif (p=="石头"and c=="剪刀")or(p=="剪刀"and c=="布")or(p=="布"and c=="石头"):
print("玩家1胜利,玩家2失败")
import random,os,time
os.system("cls")
while True:
p=input("请出拳(石头,剪刀,布):")
l=["石头","剪刀","布"]
c=random.choice(l)
if p=="石头" or p=="剪刀" or p=="布":
print("玩家1出了",p)
print("玩家2出了",c)
if p==c:
print("双方平局")
elif (p=="石头"and c=="剪刀")or(p=="剪刀"and c=="布")or(p=="布"and c=="石头"):
print("玩家1胜利,玩家2失败")
else:
print("玩家2胜利,玩家1失败")
else:
print("玩家2胜利,玩家1失败")
else:
print("Error!,错误!")
print("Please check your input!,请检查你的输入!")
exit()
print("Error!,错误!")
print("Please check your input!,请检查你的输入!")
time.sleep(2)
os.system("cls")
a=input()
if not a==2:
print(a)
else:
\ 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