示例#1
0
        static void Main(string[] args)
        {
            var plateau = new Plateau(5, 5);

            var dispatcher = new DefaultInstructionDispatcher();

            var rover1 = new Rover("Rover 1", plateau, new Position(1, 2, Direction.N));

            dispatcher.Dispatch(rover1, "LMLMLMLMM");

            var rover2 = new Rover("Rover 2", plateau, new Position(3, 3, Direction.E));

            dispatcher.Dispatch(rover2, "MMRMMRMRRM");

            Clear();

            Print(plateau);

            Print(rover1);

            Clear();

            //Print(plateau);

            //Print(rover2);

            Console.WriteLine(rover1);

            Console.WriteLine(rover2);

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

            var dispatcher = new DefaultInstructionDispatcher();

            var rover1 = new Rover("Rover 1", plateau, new Position(1, 2, Direction.N));

            dispatcher.Dispatch(rover1, "LMLMLMLMM");

            var rover2 = new Rover("Rover 2", plateau, new Position(3, 3, Direction.E));

            dispatcher.Dispatch(rover2, "MMRMMRMRRM");

            Clear();

            Print(plateau);

            Print(rover1);

            Clear();

            //Print(plateau);

            //Print(rover2);

            Console.WriteLine(rover1);

            Console.WriteLine(rover2);

            Console.ReadLine();
        }