예제 #1
0
파일: check.py 프로젝트: ykita0000/cacho
def DeMano(shoot):
    dice = util.toDice(shoot)
    if Grande(dice):
        print "  It's Grande De Mano."
    if Poker(dice):
        print "  It's Poker De Mano."
    if Full(dice):
        print "  It's Full De Mano."
    if Escalera(dice):
        print "  It's Escalera De Mano."
예제 #2
0
파일: testTurn.py 프로젝트: ykita0000/cacho
        if d:
            print d
    
def turnTwo(dice):
    pass

def turn(dice,index,n):
    if n==1 and dice[index-1]>=1:
        dice[index-1] -= n
        dice[5-index+1] += n
    elif n==2 and dice[index-1]>=2:
        dice[index-1] -= n
        dice[5-index+1] += n
    return dice


parser = OptionParser()
(options, args) = parser.parse_args()

shoot = map(lambda x:int(x), list(reduce(lambda a,b:a+b,[]+args)))
if len(shoot)!=5:
    print "okashii"
    sys.exit(1)
dice = util.toDice(shoot)
print shoot
print dice
dice = turn(dice,1,1)
print dice
print util.toShoot(dice)