Commit 7301492e by BellCodeEditor

auto save

parent 220fe62b
Showing with 39 additions and 0 deletions
import random
print("猜拳游戏")
a=input("输入start开始")
if a=="start":
while True:
b=input("请出拳 1-石头 2-剪刀 3-布")
b=int(b)
if b==1 or b==2 or b==3:
list=[1,2,3]
c=random.choice(list)
print("电脑出拳:"+str(c))
if c==1:
if b==1:
print("平局!")
if b==2:
print("失败!")
if b==3:
print("胜利!")
if c==2:
if b==1:
print("胜利!")
if b==2:
print("平局!")
if b==3:
print("失败!")
if c==3:
if b==1:
print("失败!")
if b==2:
print("胜利!")
if b==3:
print("平局!")
else:
print("请输入123中的数字!")
q=input("输入1再来一次")
q=int(q)
if q!=1:
exit()
\ 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