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)
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)