コード例 #1
0
        public static void ValidateHands(List <Card> all)
        {
            List <Card> commonCards = new List <Card>()
            {
                all[0], all[1], all[2], all[3], all[4]
            };

            Card[] playerCards = new Card[] { all[5], all[6] };
            int    total       = 0;

            while (true)
            {
                total++;
                Hand hand = HandVerification.GetBestHand(playerCards, commonCards);
                if (hand.handType != HandType.HIGH_CARD)
                {
                    Console.WriteLine("FALHOU DEPOIS DE > " + total + " DEU " + hand.handType);
                    Console.WriteLine("COMMON CARDS");
                    foreach (var card in commonCards)
                    {
                        Console.WriteLine(card.ToString());
                    }
                    Console.WriteLine("PLAYER CARDS");
                    foreach (var card in playerCards)
                    {
                        Console.WriteLine(card.ToString());
                    }
                    Console.ReadKey();
                }
                else
                {
                    Console.WriteLine("OK > " + total);
                }

                if (total == 1000000)
                {
                    Console.WriteLine("RODOU 1 MILHAO DE VEZES E NAO FALHOU");
                    Console.ReadKey();
                    break;
                }
            }
        }
コード例 #2
0
 public Hand GetHighestHand(List <Card> commonCards)
 {
     BestHand = HandVerification.GetBestHand(Cards, commonCards);
     BestHand.playerPosition = Position;
     return(BestHand);
 }