Beispiel #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to the card shuffler and sorter!");
            Console.WriteLine("Would you like to sort an out-of-order deck or shuffle a sorted deck? Enter \"sort\" or \"shuffle\" to choose.");
            var input = Console.ReadLine();
            while (!InputLogic.IsInputValid(input))
            {
                Console.WriteLine("Sorry, that's not a valid request, please try again.");
                input = Console.ReadLine();
            }
            
            while (InputLogic.IsInputValid(input))
            {
                var deckToProcess = InputLogic.RetrieveDeckToProcess(input);
                var output = InputLogic.Execute(input, deckToProcess);

                Console.WriteLine("Here's the initial deck:");
                CardLogic.DeckPrinter(deckToProcess);
                Console.WriteLine();
                Console.WriteLine("Here's the new deck:");
                CardLogic.DeckPrinter(output);

                Console.WriteLine("Would you like to see another deck? Enter \"sort\", \"shuffle\", or any value to exit.");
                input = Console.ReadLine();
            }
        }