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; }
public int Execute(VmState state, int pointer, BufferBlock <long> inputs, BufferBlock <long> outputs) => this.operatorFunc(state, pointer, this.parameterModes, inputs, outputs);