def get_ascii_str(input_str): intcode = Intcode(input_str) output = intcode.run_machine([]) return ''.join(map(chr, output))
def run_maze(input_str, maze_dirs): memory = list(map(int, input_str.split(','))) memory[0] = 2 # run mode input = [ord(c) for c in maze_dirs] robot = Intcode(memory) return robot.run_machine(input)