Commit 2bf82388 by BellCodeEditor

save project

parent b5c6bbbe
Showing with 30 additions and 0 deletions
sl = 0
sb = 0
cs = 1
dndndndndndndndndndn=["剪刀","石头","布"]
import random
for i in range(10):
print(cs)
player=input("石头/剪刀/布")
if player in dndndndndndndndndndn:
print('玩家出了'+player+"。")
dnhddnhddnhd=random.choice(dndndndndndndndndndn)
print("电脑出了"+dnhddnhddnhd)
if player == dnhddnhddnhd:
print("你和电脑打平。")
elif (player == "石头" and dnhddnhddnhd == "剪刀") or (player == "剪刀" and dnhddnhddnhd == "布") or (player == "布" and dnhddnhddnhd == "石头"):
print("你赢了一回合!")
sl = sl+1
else:
print("你失败了一回合。")
sb = sb+1
else:
print("你输错了。")
cs = cs+1
if sl == sb:
print("你和电脑平局。")
elif sl > sb:
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