示例#1
0
        static void Main(string[] args)
        {
            string testInput = "Test Input:\n5 5\n1 2 N\nLMLMLMLMM\n3 3E\nMMRMMRMRRM\n";

            Console.WriteLine(testInput);
            Plateau plateau        = new Plateau(new Position(5, 5));
            Rover   first          = new Rover(plateau, new Position(1, 2), Commands.N);
            var     firstOutput    = first.Start("LMLMLMLMM");
            Rover   second         = new Rover(plateau, new Position(3, 3), Commands.E);
            var     secondOutput   = second.Start("MMRMMRMRRM");
            string  expectedOutput = "Expected Output:\n" + firstOutput + "\n" + secondOutput;

            Console.WriteLine(expectedOutput);
            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Plateau plateau = new Plateau("Mars", new Coordinate(5, 5));

            Rover rover1 = new Rover(plateau, new Coordinate(1, 2), Direction.N);

            rover1.Start("LMLMLMLMM");

            Rover rover2 = new Rover(plateau, new Coordinate(3, 3), Direction.E);

            rover2.Start("MMRMMRMRRM");

            Console.WriteLine("Test Input:\n" + $"{plateau.Coordinate.X}  {plateau.Coordinate.Y}" + " \n1 2 N\nLMLMLMLMM\n3 3 E\nMMRMMRMRRM\n\nExpected Output :");
            Console.WriteLine($"{rover1.Coordinate.X} {rover1.Coordinate.Y} {rover1.Direction.ToString()}");
            Console.WriteLine($"{rover2.Coordinate.X} {rover2.Coordinate.Y} {rover2.Direction.ToString()}");

            Console.ReadLine();
        }