sp11--cheat

来源:互联网 发布:淘宝直通车推广方案 编辑:程序博客网 时间:2024/06/05 05:39
def cheat(boxs):
    print "cheat mode on"
    cheat_move = ""
    for move in reversed(ALLMOVES):
        if move == LEFT:
            cheat_move = RIGHT
            (boxx,boxy) = (BLANK[0]-1,BLANK[1])
        elif move == RIGHT:
            cheat_move = LEFT
            (boxx,boxy) = (BLANK[0]+1,BLANK[1])
        elif move == UP:
            cheat_move = DOWN
            (boxx,boxy) = (BLANK[0],BLANK[1]-1) 
        elif move == DOWN:
            cheat_move = UP
            (boxx,boxy) = (BLANK[0],BLANK[1]+1)
           
        anim_side(boxs,boxx,boxy, cheat_move)
        boxs[BLANK[0]][BLANK[1]].num = boxs[boxx][boxy].num
        boxs[BLANK[0]][BLANK[1]].is_blank = False
        boxs[boxx][boxy].move_to(cheat_move)
原创粉丝点击