Ejemplo n.º 1
0
        private void executeInstructionList(InstructionList list)
        {
            list.zeroOutVariables();
            terminateInstructionList = false;
            int instructionPointer = 0;

            instructionList = list;
            do
            {
                Instruction instruction = list.getInstruction(instructionPointer++);
                instruction.executeOn(this);
                totalInstructionExecuted++;
                if (totalInstructionExecuted > robotInstructionLimit)
                {
                    break;
                }
                instructionPointer       = Math.Abs((instructionPointer + changeInstructionPointer) % instructionList.Size);
                changeInstructionPointer = 0;
            } while (!terminateInstructionList && !finished);
        }