def view_execute_instructions(id, instruction): maze = db_get_maze(id) if maze is None: return jsonify({"error" : "Maze not found"}), 404 elif instruction is None: return jsonify({"error" : "Empty instruction"}), 400 success, instructions = runtime.compile(instruction) if not success: return jsonify(instructions), 200 result = runtime.run_instructions(maze, instructions) print(result) return jsonify(result), 200
def view_get_maze(id): maze = db_get_maze(id) if maze is None: return jsonify({}), 404 return jsonify(maze), 200