Exemple #1
0
        public void DealInitialCards()
        {
            DeclarationReset();
            Deck deckShuffle = new Deck();

            listShuffleDeck = deckShuffle.CardShuffleList();
            listPlayerCard  = new List <string>();
            listHouseCard   = new List <string>();

            dealer.GetDecksOfCards(listShuffleDeck, 2, listHouseCard);
            Console.WriteLine("House: *,{0}", listHouseCard[1].ToString());

            player.GetDecksOfCards(listShuffleDeck, 2, listPlayerCard);
            Console.WriteLine("Player: {0},{1} ", listPlayerCard[0].ToString(), listPlayerCard[1].ToString());

            while (playing)
            {
                Console.Write("What would you like to do: deal, hit, stand, quit?: ");
                string response = Console.ReadLine();
                switch (response.ToUpper())
                {
                case "HIT":
                    Hit();
                    break;

                case "STAND":
                    Stand();
                    break;

                case "QUIT":
                    Environment.Exit(-1);
                    break;

                case "DEAL":
                    Console.Clear();
                    DealInitialCards();
                    break;

                default:
                    Console.WriteLine("Wrong Command. Try again");
                    break;
                }
            }
            BusterResult(listHouseCard, listPlayerCard);
        }