Commit ce224939 by BellCodeEditor

save project

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