Ejemplo n.º 1
0
        public void DisplayWinner()
        {
            PokerJudge pokerJudge = new PokerJudge();
            string     winner     = pokerJudge.GetWinner(_fiveCommunityCards, _twoHoleCardsPerPlayer);

            Console.WriteLine();
            Console.WriteLine("WINNER IS: " + winner + "with " + pokerJudge.WinningHandDisplayString);
        }
Ejemplo n.º 2
0
        public void Run(string input, TextWriter output)
        {
            StringReader reader = new StringReader(input);

            string appendedInput = null;
            string line          = reader.ReadLine();

            while (line != null)
            {
                appendedInput += line;

                if (line == string.Empty)
                {
                    InputParser inputParser = new InputParser(appendedInput);
                    PokerJudge  pokerJudge  = new PokerJudge();
                    string      winner      = pokerJudge.GetWinner(inputParser.CommunityCards, inputParser.PlayerCards);
                    output.Write(winner);
                    return;
                }
                line = reader.ReadLine();
            }
        }