Commit 299cb5f0 by BellCodeEditor

save project

parent 9908e5af
Showing with 31 additions and 8 deletions
# 玩家出拳
s=input('请输入:')
print('玩家出:'+s)
import random
a=['石头','剪刀','布']
c=random.choice(a)
print('人机出:'+c)
\ No newline at end of file
score=0
while True:
s=input('请输入:')
print('玩家出:'+s)
import random
a=['石头','剪刀','布']
c=random.choice(a)
print('人机出:'+c)
if s in a:
if s==c:
print('平局')
print(score)
elif s=='石头'and c=='布':
print('输了')
score=score-1
print(score)
elif s=='布'and c=='剪刀':
print('输了')
score=score-1
print(score)
elif s=='剪刀'and c=='石头':
print('输了')
score=score-1
print(score)
else:
print('赢了')
score=score+1
print(score)
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