public ComputerStatus Execute() { var test = IntCodes.Count - InstructionPointer - 4 > 0 ? 4 : IntCodes.Count - InstructionPointer; var currentInstruction = new Instruction(IntCodes.GetRange((int)InstructionPointer, (int)test)); var result = executeInstruction(currentInstruction); InstructionPointer += result.Item2; Status = result.Item1; return(result.Item1); }
public void Start() { if (InstructionPointer == 0) { IntCodes.AddRange(new long[5000]); } while (Execute() == ComputerStatus.Running) { ; } if (Status == ComputerStatus.Waiting) { WaitingSince = DateTime.Now; } return; }