- 帖子
- 20
- 精华
- 0
- 积分
- 166
- 阅读权限
- 20
- 注册时间
- 2018-10-15
- 最后登录
- 2019-4-13
|
a=False
while a==False:
from random import choice
score=[0,0]
direction=['left','right','center']
print'Shooting ball games!'
for i in range(5):
print'---- Round %d - You Kick! ----'%(i+1)
print'choose one side to shoot'
print'left right center'
you=raw_input()
if (you=='left')or(you=='right')or(you=='center'):
print 'you kicked' + you
com=choice(direction)
print 'computer saved'+com
if you!=com:
print'Goal!'
score[0]+=1
else:
print'Oops...'
else:
print'Your input is incorrect.\nWarning, computer score!'
score[1]+=1
print'Score: %d(you) - %d(com)\n' %(score[0],score[1])
print'---- Round %d - You Save! ----'%(i+1)
print'choose one side to save'
print'lefe center right'
you=raw_input()
if (you=='left')or(you=='right')or(you=='center'):
print'you saved'+you
com=choice(deirection)
print'computer kicked'+com
if you==com:
print'Savde!'
else:
print'Oops...'
score[1]+=1
else:
print'Your input is incorrect.\nWarning, computer score!'
score[1]+=1
print'Score: %d(you) - %d(com)\n' %(score[0],score[1])
if score[0]>=score[1]:
if score[0]>score[1]:
print'You win!'
else:
print'The game has drawn!'
else:
print'You lose!'
print'\nIf you want to continue the game, please enter 1.\nExit input 0'
b=input()
if b==('1'):
a=True
|
|