Exemple #1
0
        //Method to show only one card and ask about the next one
        private static void ShowOneCard(int size)
        {
            Deck deck = new Deck(size);

            deck.Shuffle();
            for (int i = 0; i < size; i++)
            {
                Console.WriteLine("{0,-19}", deck.ShowCards());
                Console.WriteLine("\r\nDo you want to see a next card or do you want to close this app?\r\n" +
                                  "1 - Next card.\r\n" +
                                  "2 - Close.\r\n");
                int input_third = Validate();
                if (input_third == 1)
                {
                    Console.WriteLine("Next card is:\r\n");
                }
                else if (input_third == 2)
                {
                    Console.WriteLine("Application is ready to close. Press 'ESC' or 'X' to Exit.\r\n");
                    CloseConsole();
                }
                else
                {
                    Console.WriteLine("You typed a wrong number. Press 'ESC' or 'X' to Exit.\r\n");
                    CloseConsole();
                }
            }
        }
Exemple #2
0
        //Method to show all cards in the deck
        private static void ShowAllCards(int size)
        {
            Deck deck = new Deck(size);

            deck.Shuffle();
            for (int i = 0; i < size; i++)
            {
                Console.WriteLine("{0,-19}", deck.ShowCards());
                if ((i + 1) % 4 == 0)
                {
                    Console.WriteLine();
                }
            }
        }