Ejemplo n.º 1
0
        public void HowFarIsFirstDuplicate_IsCorrect()
        {
            var gps = new Gps();

            gps.Move(new Turn("R8"));
            gps.Move(new Turn("R4"));
            gps.Move(new Turn("R4"));
            gps.Move(new Turn("R8"));

            Assert.Equal(4, gps.HowFarIsFirstDuplicate());
        }
Ejemplo n.º 2
0
        public static void Problem1()
        {
            var turns = TurnReader.FromFile("P1.txt").ToArray();

            var gps = new Gps();

            foreach (var turn in turns)
            {
                gps.Move(turn);
            }

            Console.WriteLine("How far away is first duplicate?  {0}", gps.HowFarIsFirstDuplicate());
        }