Exemplo n.º 1
0
        public void Day5_Indirect_Samples(long[] initial, long[] final)
        {
            var interpreter = new IntComp(initial, Enumerable.Empty <long>());

            _ = interpreter.Run().ToList();
            var memory = interpreter.GetMemory(initial.Length);

            Assert.Equal(final, memory);
        }
Exemplo n.º 2
0
        public void Day5_IO_Read_Samples()
        {
            var program     = new long[] { 3, 1, 99 };
            var interpreter = new IntComp(program, new long[] { 42 });

            _ = interpreter.Run().ToList();
            var memory = interpreter.GetMemory(program.Length);

            Assert.Equal(new long[] { 3, 42, 99 }, memory);
        }