예제 #1
0
        public void Day3_Should_find_Position2_part1()
        {
            SpiralGridModel gridModel = new SpiralGridModel();
            NumberModel     number    = gridModel.FindPosition(1024);
            //List<NumberModel> numberList = gridModel.FindPosition(1024);
            int steps = gridModel.GetDistance(number);

            Assert.AreEqual(31, steps);
        }
예제 #2
0
        static void Main(string[] args)
        {
            SpiralGridModel gridModel = new SpiralGridModel();

            Console.WriteLine("created gridmodel");
            NumberModel number = gridModel.FindPosition(289326);

            Console.WriteLine("Done findPosition");
            int steps = gridModel.GetDistance(number);

            Console.WriteLine(steps);
            Console.ReadKey();
        }
예제 #3
0
        public void Day3_Should_find_Position4_part1()
        {
            SpiralGridModel gridModel = new SpiralGridModel();
            NumberModel     number    = gridModel.FindPosition(1);

            //List<NumberModel> numberList = gridModel.FindPosition(12, Number);
            //NumberModel number = numberList[numberList.Count - 1];
            Assert.AreEqual(0, number.X_position);
            Assert.AreEqual(0, number.Y_position);
            int steps = gridModel.GetDistance(number);

            Assert.AreEqual(0, steps);
        }