public IntcodeInterpreter(IntcodeInterpreter i)
        {
            _program        = new ProgramMemory(i._program);
            _addressPointer = i._addressPointer;
            _relativeBase   = i._relativeBase;
            IsHalted        = i.IsHalted;

            _interractiveMode = i._interractiveMode;
            _output           = i._output;
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
 public Droid(int x, int y, IntcodeInterpreter i)
 {
     PositionX   = x;
     PositionY   = y;
     Interpreter = new IntcodeInterpreter(i);
 }