Пример #1
0
        public void TestFindCollission(int[] input, int expectedCycles)
        {
            var sut    = new MemoryBank();
            var result = sut.FindCollision(input);

            Assert.AreEqual(expectedCycles, result);
        }
Пример #2
0
        static void Main(string[] args)
        {
            var memoryBank = new MemoryBank();

            Console.WriteLine("Hello World!");

            var input  = new[] { 14, 0, 15, 12, 11, 11, 3, 5, 1, 6, 8, 4, 9, 1, 8, 4 };
            var cycles = memoryBank.FindCollision(input);

            Console.WriteLine($"Answer: {cycles} cycles");
            Console.ReadKey();
        }