Exemple #1
0
        static void Main(string[] args)
        {
            int input = 277678;
            SpiralMemorySolver solver = new SpiralMemorySolver(input);

            Console.WriteLine(solver.SolveManhattanDistance());
            Console.ReadLine();
        }
Exemple #2
0
        public void SolveManhattanCornerDistanceTest()
        {
            SpiralMemorySolver solver = new SpiralMemorySolver(17);

            Assert.AreEqual(4, solver.SolveManhattanDistance());
        }
Exemple #3
0
        public void SolveManhattanEdgeDistanceTest()
        {
            SpiralMemorySolver solver = new SpiralMemorySolver(18);

            Assert.AreEqual(3, solver.SolveManhattanDistance());
        }
Exemple #4
0
        public void SolveManhattanZeroDistanceTest()
        {
            SpiralMemorySolver solver = new SpiralMemorySolver(1);

            Assert.AreEqual(0, solver.SolveManhattanDistance());
        }