示例#1
0
        public static void makeChoice()
        {
            Console.WriteLine("Commands:");
            Console.WriteLine("[D]isplay the cards in the deck");
            Console.WriteLine("[S]huffle the cards in the deck.");
            Console.WriteLine("[So]rt the cards in the deck.");
            Console.WriteLine("[Q]uit.");
            string choice = Console.ReadLine().ToLower();

            if (choice == "d")
            {
                playDeck.showCards();
                makeChoice();
            }
            else if (choice == "s")
            {
                playDeck.shuffle();
                playDeck.showCards();
                makeChoice();
            }
            else if (choice == "so")
            {
                playDeck.buildDeck();
                playDeck.showCards();
                makeChoice();
            }
            else if (choice == "q")
            {
                Console.WriteLine("Bye.");
            }
            else
            {
                Console.WriteLine("Uh so you seem to be having some trouble interpreting the instructions.");
                Console.WriteLine("Just press the 'D', 'S', 'So' or 'Q' and hit enter.");
                makeChoice();
            }
        }