- 帖子
- 2
- 精华
- 0
- 积分
- 9
- 阅读权限
- 10
- 注册时间
- 2017-7-11
- 最后登录
- 2017-7-12
|
点球大战#-*-coding:utf8;-*-
#qpy:2
#qpy:console
print "点球大战"
from random import choice#一开始浪了,使用choice没有def#
score=[0,0]
dere=['left','middle','right']
guess=['front','back']
shooter=['computer','playername']
t=0
print 'what is your name?'
shooter[1]=raw_input()
print'please guess the front or back'
if raw_input()==choice(guess):
t=1
print'you first'
else:
t=0
print'the computer first'
def goal(t):
for i in range(1,6):
print '======%s turn round %d======='%(shooter[t],i)
print 'please choice your der(left,middle,right)'
you=raw_input()
com=choice(dere)
k=[com,you]
print 'computer choice the %s'%com
if you!=com:
print 'Goal'
score[t]+=1
else:
print 'Saved'
goal(t)
t=abs(t-1)#小得意#
goal(t)
print 'player com:you'
print 'score %d :%d'%(score[0],score[1])
|
|