public IntcodeInterpreter(IntcodeInterpreter i) { _program = new ProgramMemory(i._program); _addressPointer = i._addressPointer; _relativeBase = i._relativeBase; IsHalted = i.IsHalted; _interractiveMode = i._interractiveMode; _output = i._output; }
static void Main(string[] args) { var inputFile = Environment.CurrentDirectory + "//input.txt"; // Input file should be a single line string line = System.IO.File.ReadAllLines(inputFile)[0]; IntcodeInterpreter discoveryInterpreter = new IntcodeInterpreter(line, isInterractiveMode: false); Droid mazeDiscoveryDroid = new Droid(0, 0, discoveryInterpreter); var solver = new DroidMazeSolver(line); solver.DiscoverMaze(mazeDiscoveryDroid); var start = (0, 0); var end = solver.OxygenSystemLocation; solver.FindShortestPathUsingBFS(start, end); solver.PrintMaze(); }
public Droid(int x, int y, IntcodeInterpreter i) { PositionX = x; PositionY = y; Interpreter = new IntcodeInterpreter(i); }