Exemple #1
0
        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 }));
        }
Exemple #2
0
                    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));
        }
Exemple #3
0
        public void Test(int[] input, int[] output)
        {
            var cpu = new IntCodeCPU(input, new int[] {});

            cpu.Run();
            Assert.True(cpu.Memory.SequenceEqual(output));
        }