Exemplo n.º 1
0
        public AsyncIntCodeVm(long[] memory)
        {
            this.state = new VmState();
            memory.CopyTo(this.state.Memory, 0);

            this.InputBuffer  = new BufferBlock <long>();
            this.OutputBuffer = new BufferBlock <long>();

            this.InstructionFactory = BufferedInstructionFactory.GetBufferedInstruction;
        }
Exemplo n.º 2
0
 public int Execute(VmState state, int pointer, BufferBlock <long> inputs, BufferBlock <long> outputs) => this.operatorFunc(state, pointer, this.parameterModes, inputs, outputs);