public int Solve(string input, int pos1Value, int pos2Value) { var opcodes = input.ToOpcodes(); opcodes[1] = pos1Value; opcodes[2] = pos2Value; return(IntcodeRunner.Run(opcodes)[0]); }
public void Sample4() { var output = IntcodeRunner.Run("1,1,1,4,99,5,6,0,99".ToOpcodes()).ToStringValue(); Assert.Equal("30,1,1,4,2,5,6,0,99", output); }
public void Sample1() { var output = IntcodeRunner.Run("1,0,0,0,99".ToOpcodes()).ToStringValue(); Assert.Equal("2,0,0,0,99", output); }
public void Sample3() { var output = IntcodeRunner.Run("2,4,4,5,99,0".ToOpcodes()).ToStringValue(); Assert.Equal("2,4,4,5,99,9801", output); }