public void SampleData()
        {
            var input = new[] { "cpy 2 a",
                                "tgl a",
                                "tgl a",
                                "tgl a",
                                "cpy 1 a",
                                "dec a",
                                "dec a" };

            _day23.ProcessInstructions(input);

            Console.WriteLine(_day23.A);
            Assert.AreEqual(3, _day23.A);
        }
        public void SampleInstructions()
        {
            var input = new[]
            {
                "inc a",
                "jio a, +2",
                "tpl a",
                "inc a"
            };

            _day23.ProcessInstructions(input);

            Assert.AreEqual(2, _day23.Registers['a']);
        }
Exemple #3
0
    public void Y2015_Day23_ProcessInstructions()
    {
        // Arrange
        IList <string> instructions = new[]
        {
            "inc a",
            "jio a, +2",
            "tpl a",
            "inc a",
        };

        uint initialValue = 0;

        // Act
        (uint a, uint b) = Day23.ProcessInstructions(instructions, initialValue, Logger);

        // Assert
        a.ShouldBe(2u);
        b.ShouldBe(0u);
    }