- 帖子
- 9
- 精华
- 0
- 积分
- 48
- 阅读权限
- 10
- 注册时间
- 2015-5-6
- 最后登录
- 2015-7-6
|
__author__ = 'Administrator'
score_you = 0
score_com = 0
for i in range(5):
print '=== You Kick - Round %d ===' % (i+1)
print 'Choose a side to shoot(left,middle,right):'
youChoice = raw_input()
print 'You kicked ' + youChoice
direction = ['left', 'middle', 'right']
comChoice = choice(direction)
print 'Computer saved ' + comChoice
if youChoice != comChoice:
print 'Go~Go~Goal~~~\n'
score_you += 1
else:
print 'Oops...\n'
if abs(score_you-score_com) > (5-i):
break
print '=== You Save - Round %d ===' % (i+1)
print 'Choose a side to save(left,middle,right):'
youChoice = raw_input()
print 'You saved ' + youChoice
direction = ['left', 'middle', 'right']
comChoice = choice(direction)
print 'Computer kicked ' + comChoice
if youChoice == comChoice:
print 'Sa~Sa~Saved~~~'
else:
print 'Oops...'
score_com += 1
print 'you %d : computer %d\n' % (score_you, score_com)
if abs(score_you-score_com) >= (5-i):
break
while score_you == score_com:
i += 1
print '=== You Kick - Round %d ===' % (i+1)
print 'Choose a side to shoot(left,middle,right):'
youChoice = raw_input()
print 'You kicked ' + youChoice
direction = ['left', 'middle', 'right']
comChoice = choice(direction)
print 'Computer saved ' + comChoice
if youChoice != comChoice:
print 'Go~Go~Goal~~~\n'
score_you += 1
else:
print 'Oops...\n'
print '=== You Save - Round %d ===' % (i+1)
print 'Choose a side to save(left,middle,right):'
youChoice = raw_input()
print 'You saved ' + youChoice
direction = ['left', 'middle', 'right']
comChoice = choice(direction)
print 'Computer kicked ' + comChoice
if youChoice == comChoice:
print 'Sa~Sa~Saved~~~'
else:
print 'Oops...'
score_com += 1
print 'you %d : computer %d\n' % (score_you, score_com)
if score_you > score_com:
print 'You Win'
else:
print 'You Lose' |
|