Пример #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Welcome to Blackjack");
            Console.WriteLine("Press 'H' to Hit or 'Enter' to Hold\n");
            IDealer GameDealer = new Dealer(1, 1);

            GameDealer.CreatePlayers();
            GameDealer.StartNewRound();

            ConsoleUtilities.WritePlayerHandsToConsole(GameDealer);
            Console.WriteLine("Press 'H' or 'Enter' to Hold\n");
            while (true)
            {
                var choice = Console.ReadKey(true);
                switch (choice.Key)
                {
                case ConsoleKey.H:
                    GameDealer.PlayerHit(0);     //Player 1 takes hit or gets dealt 1 card
                    ConsoleUtilities.WritePlayerHitDialogToConsole(GameDealer);
                    break;

                case ConsoleKey.Enter:
                    GameDealer.Hold();     //Initiate dealers turn
                    ConsoleUtilities.WriteDealerHitDialogToConsole(GameDealer);
                    break;

                case ConsoleKey.Escape:
                    Environment.Exit(0);
                    break;
                }
            }
        }