예제 #1
0
        public int playout(int card_one, int card_two, int card_three, int card_four, int card_five, int card_six)
        {
            int      score        = 0;
            int      number_plays = 0;
            deck     d            = new deck();
            DateTime start        = DateTime.Now;
            DateTime end          = DateTime.Now;

            for (; ;)
            {
                d.removeCard(card_one - 1);
                d.removeCard(card_two - 1);
                d.removeCard(card_three - 1);
                d.removeCard(card_four - 1);
                d.removeCard(card_five - 1);
                d.removeCard(card_six - 1);
                d.shuffle();
                score += this.score(card_one - 1, card_two - 1, card_three - 1, card_four - 1, card_five - 1, card_six - 1, d.draw());
                end    = DateTime.Now;
                number_plays++;
                TimeSpan Duration = end - start;
                if (Duration.TotalMilliseconds > MAX_TIME)
                {
                    break;
                }
            }

            return(score / number_plays);
        }
예제 #2
0
        public int playout(int card_one, int card_two, int card_three, int card_four, int card_five, int card_six)
        {
            int score = 0;
            int number_plays = 0;
            deck d = new deck();
            DateTime start = DateTime.Now;
            DateTime end = DateTime.Now;
            for (; ; )
            {
                d.removeCard(card_one-1);
                d.removeCard(card_two-1);
                d.removeCard(card_three-1);
                d.removeCard(card_four-1);
                d.removeCard(card_five-1);
                d.removeCard(card_six-1);
                d.shuffle();
                score += this.score(card_one-1, card_two-1, card_three-1, card_four-1, card_five-1, card_six-1, d.draw());
                end = DateTime.Now;
                number_plays++;
                TimeSpan Duration = end - start;
                if (Duration.TotalMilliseconds > MAX_TIME)
                {
                    break;
                }
            }

            return score / number_plays;
        }