Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Poker Hand");
            PokerDeck pDeck = new PokerDeck();
            var       hand  = pDeck.DealCards();

            foreach (var card in hand)
            {
                Console.WriteLine($"{card.Value.ToString()} of {card.Suit.ToString()}");
            }

            Console.WriteLine();
            Console.WriteLine("*************************************");
            Console.WriteLine();

            Console.WriteLine("BlackJack Hand");
            BlackJackDeck bDeck = new BlackJackDeck();
            var           bhand = bDeck.DealCards();

            foreach (var card in bhand)
            {
                Console.WriteLine($"{card.Value.ToString()} of {card.Suit.ToString()}");
            }

            Console.ReadLine();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Menu Option logic
        /// </summary>
        private void menuOption()
        {
            int    value;
            string input = Console.ReadLine();

            if (!int.TryParse(input, out value))
            {
                Console.WriteLine("Invalid Number Type");
                return;
            }

            if (checkDeck())
            {
                switch (value)
                {
                case 1:
                    deck = new PokerDeck();
                    deckBuiltMessage();
                    break;

                case 2:
                    deck.shuffle();
                    break;

                case 3:
                    getCards();
                    break;

                case 4:
                    displayCards();
                    break;

                case 5:
                    deck.displayCardsInDeck();
                    break;

                case 6:
                    deck.countCardsLeftInDeck();
                    break;

                case 7:
                    cardSearch();
                    break;

                case 8:
                    quit();
                    break;

                default:
                    break;
                }
            }
            else
            {
                switch (value)
                {
                case 1:
                    deck = new PokerDeck();
                    deckBuiltMessage();
                    break;

                case 2:
                    quit();
                    break;

                default:
                    break;
                }
            }

            if (!quitFlag)
            {
                continuePrompt();
                Console.Clear();
                startMenu();
            }
        }