Beispiel #1
0
        /// <summary>
        /// Entry point into console application.
        /// </summary>
        static void Main()
        {
            // Create user and let her compute
            User user = new User();

            // User presses calculator buttons
            user.Compute('+', 100);
            user.Compute('-', 50);
            user.Compute('*', 10);
            user.Compute('/', 2);

            // Undo 4 commands
            user.Undo(4);

            // Redo 3 commands
            user.Redo(3);

            // Wait for user
            Console.ReadKey();
        }
Beispiel #2
0
        static void Main()
        {
            User user = new User();

            user.Compute("steps forward",100);
            user.Compute("steps back",50);
            user.Compute("steps left",45);
            user.Compute("steps right",70);

            user.Undo(3);

            user.Redo(2);

            Console.ReadKey();
        }