Exemplo n.º 1
0
        public bool IsDrawValid(Draw draw, List <Draw> pastDraws)
        {
            if (pastDraws != null)
            {
                // Ignore draws with past big prizes

                if (!IsPointsInRange(draw, pastDraws))
                {
                    return(false);
                }

                // Ignore draws already drawn

                if (!IsNotEqualPastDraws(draw, pastDraws))
                {
                    return(false);
                }

                int average = MathExtensions.Average(pastDraws);
                int stdDev  = MathExtensions.StandardDeviation(pastDraws, average);

                return(IsDrawValid(draw, MathExtensions.LowerLimit(average, stdDev), MathExtensions.UpperLimit(average, stdDev)));
            }

            return(IsDrawValid(draw, NUMBERS_LOWER_LIMIT, NUMBERS_UPPER_LIMIT));
        }