Esempio n. 1
0
        static ulong testMethod(LotteryMethod method, int tests)
        {
            ulong trySum = 0;

            for (int i = 0; i < tests; i++)
            {
                trySum += calculateMethodTries(method);
            }
            ulong avgTries = trySum / (ulong)tests;

            return(avgTries);
        }
Esempio n. 2
0
        static ulong calculateMethodTries(LotteryMethod method)
        {
            Random rand       = new Random();
            ulong  tries      = 0;
            int    currentTry = rand.Next(0, 1000);

            while (currentTry != rand.Next(0, 1000))
            {
                tries++;
                if (method == LotteryMethod.Justin)
                {
                    currentTry = rand.Next(0, 1000);
                }
            }
            return(tries);
        }