public void TestIO() { var cpu = new IntCodeCPU(new int[] { 3, 0, 4, 0, 99 }, new int[] { 33 }); cpu.Run(); Assert.True(cpu.Outputs.SequenceEqual(new int[] { 33 })); }
new int[] { 9 }, new int[] { 1001 })] // <8: 999, =8: 1000 >8: 1001 public void TestJumps(int[] code, int[] inputs, int[] outputs) { var cpu = new IntCodeCPU(code, inputs); cpu.Run(); Assert.True(cpu.Outputs.SequenceEqual(outputs)); }
public void Test(int[] input, int[] output) { var cpu = new IntCodeCPU(input, new int[] {}); cpu.Run(); Assert.True(cpu.Memory.SequenceEqual(output)); }