Commit 906d6521 by BellCodeEditor

save project

parent 0ffdefeb
Showing with 45 additions and 4 deletions
# 我们都爱夸夸夸
a = input("请出拳:")
print("玩家出拳:"+a)
\ No newline at end of file
import random
d = 0
c = 0
for i in range(3):
a = input("请出拳:")
print("玩家出拳:" + a)
list = ["石头","剪刀","布"]
if a in list:
b = random.choice(list)
print("电脑出拳:" + b)
if b == a:
print("平局")
d = d + 1
elif(a == "石头" and b == "布") or (a == "剪刀" and b == "石头") or (a == "布" and b == "剪刀"):
print("你输了")
else:
print("你赢了")
c = c + 1
print( )
else:
print("输入错误,游戏无法进行")
While d == 0:
for i in range(d):
a = input("请出拳:")
print("玩家出拳:" + a)
list = ["石头","剪刀","布"]
if a in list:
b = random.choice(list)
print("电脑出拳:" + b)
if b == a:
print("平局")
d = d + 1
elif(a == "石头" and b == "布") or (a == "剪刀" and b == "石头") or (a == "布" and b == "剪刀"):
print("你输了")
else:
print("你赢了")
c = c + 1
print( )
if c < 2:
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