def wrapping_move_action_string(self, state, wrap_col = False): puzzle = XPuzzle(self.rows, self.cols, state) tile_moved = puzzle.wrapping_move(wrap_col) if( tile_moved != -1): return {'key': puzzle.current_state_to_string(), 'tile_moved': tile_moved} else: return -1
def diagonal_move_action_string(self, state, is_wrapping): puzzle = XPuzzle(self.rows, self.cols, state) tile_moved = puzzle.diagonal_move(is_wrapping) if( tile_moved != -1): return {'key': puzzle.current_state_to_string(), 'tile_moved': tile_moved} else: return -1
def normal_move_action_string(self, state, action): puzzle = XPuzzle(self.rows, self.cols, state) tile_moved = puzzle.regular_move(action) if( tile_moved != -1): return {'key': puzzle.current_state_to_string(), 'tile_moved': tile_moved} else: return -1