Exemplo n.º 1
0
        private static void playFourcardAndAcesUp(FourCardPoker fourCard, FourCardPoker acesUp, CardDeck deck)
        {
            // new give
            deck.Shuffle();

            for (int i = 0; i < NUMBER_OF_PLAYERS; i++)
            {
                Hand playerHand = new Hand(deck.GetCards(FIVE_CARD_POKER));
                playerHand = FourCardPoker.SortAndRankHandForFourCard(playerHand);
                fourCardPlayers[i].SetHand(playerHand);
                acesUpPlayers[i].SetHand(playerHand);
            }

            Hand dealerHand = new Hand(deck.GetCards(FOUR_CARD_DEALER_HAND));

            dealerHand = FourCardPoker.SortAndRankHandForFourCard(dealerHand);

            fourCard.SetHand(dealerHand);
            acesUp.SetHand(dealerHand);

            CardDeck acesUpDeck = deck.Clone();

            for (int i = 0; i < NUMBER_OF_PLAYERS; i++)
            {
                fourCard.Play(fourCardPlayers[i], deck);
                acesUp.Play(acesUpPlayers[i], acesUpDeck);
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.OutputEncoding = System.Text.Encoding.UTF8;

            CardDeck deck = new CardDeck();

            CaribbeanStudPoker caribbean      = new CaribbeanStudPoker();
            OasisPoker         oasis          = new OasisPoker();
            FourCardPoker      fourcard       = new FourCardPoker();
            FourCardPoker      fourcardAcesUp = new FourCardPoker(ACES_UP);

            createPlayers();

            for (int i = 0; i < 1000; i++)
            {
                //Console.WriteLine("");


                for (int loop = 0; loop < 1; loop++)
                {
                    playCaribbeanAndOasis(caribbean, oasis, deck);

                    playFourcardAndAcesUp(fourcard, fourcardAcesUp, deck);
                }
            }

            // Caribbean Stud Poker:
            Console.WriteLine("");
            Console.WriteLine("Caribbean Stud Poker:");
            Console.WriteLine("Casino: wins = " + caribbean.GetWins() + ", losses = " + caribbean.GetLosses() + ", draws = " + caribbean.GetDraws());
            Console.WriteLine("total balance = " + caribbean.GetBalance());
            Console.WriteLine("");
            Console.WriteLine("Number of Folds = " + caribbean.GetFolds() + ", Number of Calls = " + caribbean.GetCalls());
            Console.WriteLine("");
            Console.WriteLine("Number of Non Qualified games = " + caribbean.GetNq());
            Console.WriteLine("Total Volume: " + caribbean.GetVolume());
            Console.WriteLine("");
            Console.WriteLine("House's edge: " + caribbean.GetHousesEdge());
            Console.WriteLine("---------------------------");

            // Oasis Poker:
            Console.WriteLine("Oasis Poker:");
            Console.WriteLine("");
            Console.WriteLine("Casino:" + " wins = " + oasis.GetWins() + ", losses = " + oasis.GetLosses() + ", draws = " + oasis.GetDraws());
            Console.WriteLine("total balance = " + oasis.GetBalance());
            Console.WriteLine("");
            Console.WriteLine("Number of Folds = " + oasis.GetFolds() + ", Number of Calls = " + oasis.GetCalls());
            Console.WriteLine("");
            Console.WriteLine("Number of Non Qualified games = " + oasis.GetNq());
            Console.WriteLine("");
            Console.WriteLine("Total Volume: " + oasis.GetVolume());
            Console.WriteLine("House's edge: " + oasis.GetHousesEdge());

            Console.WriteLine("---------------------------");

            // Four Card Poker: Aces Up
            Console.WriteLine("Four Card Poker; Aces Up:");
            Console.WriteLine("");
            Console.WriteLine("Casino:" + " wins = " + fourcardAcesUp.GetWins() + ", losses = " + fourcardAcesUp.GetLosses() + ", draws = " + fourcardAcesUp.GetDraws());
            Console.WriteLine("total balance = " + fourcardAcesUp.GetBalance());
            Console.WriteLine("");
            Console.WriteLine("Number of Folds = " + fourcardAcesUp.GetFolds() + ", Number of Calls = " + fourcardAcesUp.GetCalls());

            Console.WriteLine("");
            Console.WriteLine("Total Volume: " + fourcardAcesUp.GetVolume());
            Console.WriteLine("House's edge: " + fourcardAcesUp.GetHousesEdge());

            Console.WriteLine("---------------------------");
            // Four Card Poker:
            Console.WriteLine("Four Card Poker:");
            Console.WriteLine("");
            Console.WriteLine("Casino:" + " wins = " + fourcard.GetWins() + ", losses = " + fourcard.GetLosses() + ", draws = " + fourcard.GetDraws());
            Console.WriteLine("total balance = " + fourcard.GetBalance());
            Console.WriteLine("");
            Console.WriteLine("Number of Folds = " + fourcard.GetFolds() + ", Number of Calls = " + fourcard.GetCalls());

            Console.WriteLine("");
            Console.WriteLine("Total Volume: " + fourcard.GetVolume());
            Console.WriteLine("House's edge: " + fourcard.GetHousesEdge());
        }