コード例 #1
0
        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);
        }
コード例 #2
0
 public void Start()
 {
     if (InstructionPointer == 0)
     {
         IntCodes.AddRange(new long[5000]);
     }
     while (Execute() == ComputerStatus.Running)
     {
         ;
     }
     if (Status == ComputerStatus.Waiting)
     {
         WaitingSince = DateTime.Now;
     }
     return;
 }