예제 #1
0
파일: Program.cs 프로젝트: jwood803/Katas
        static void Main(string[] args)
        {
            var game = new PokerGame("player1", "player2");

            //var hand = new PokerHand(player1Hand, player2Hand);
            //hand.DisplayWinner();
        }
예제 #2
0
        public static void Main(string[] args)
        {
            PokerGame game = new PokerGame();

            string player = Console.ReadLine();
            string cards  = "";

            if (!player.Equals(""))
            {
                cards = Console.ReadLine();
            }

            int nPlayers = 1;

            try
            {
                while (!player.Equals("") && !cards.Equals("") && nPlayers <= 10)
                {
                    game.AddPlayer(player, cards.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries));

                    player = Console.ReadLine();
                    if (!player.Equals(""))
                    {
                        cards = Console.ReadLine();
                    }

                    nPlayers++;
                }

                foreach (PokerHand p in game.GetWinners())
                {
                    Console.WriteLine(p.PlayerName + " wins");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Something went wrong. " + ex.Message);
            }
        }