public List <int[]> GenerateSequence()
        {
            int[] historicFigureList = GroupAndCountOnly(lotteryDataServices.GetTopDrawnDigitFromDateRange(
                                                             (DateTime)GetFieldParamValue(GeneratorParamType.FROMDATE),
                                                             (DateTime)GetFieldParamValue(GeneratorParamType.TODATE)).ToArray());

            LotteryTicketPanel lotteryTicketPanel = lotteryDataServices.GetLotteryTicketPanel();
            List <int[]>       sequenceArr        = new List <int[]>();
            Random             rnd = new Random();

            for (int ctr = 0; ctr < GetFieldParamValueForCount(); ctr++)
            {
                int[] result = new int[lotteryTicketPanel.GetGameDigitCount()];
                for (int seqCtr = 0; seqCtr < lotteryTicketPanel.GetGameDigitCount(); seqCtr++)
                {
                    while (true)
                    {
                        int anyDigit    = rnd.Next(0, historicFigureList.Length);
                        int pickupDigit = historicFigureList[anyDigit];
                        if (!result.Contains(pickupDigit))
                        {
                            result[seqCtr] = pickupDigit;
                            break;
                        }
                    }
                }
                Array.Sort(result);
                sequenceArr.Add(result);
            }
            return(sequenceArr);
        }
        public List <int[]> GenerateSequence()
        {
            LotteryTicketPanel lotteryTicketPanel = lotteryDataServices.GetLotteryTicketPanel();
            Random             rnd         = new Random();
            List <int>         drawnDigits = lotteryDataServices.GetTopDrawnDigitFromJackpotsResults();
            List <int[]>       sequenceArr = new List <int[]>();

            for (int itr = 1; itr <= GetFieldParamValueForCount(); itr++)
            {
                int[] result = new int[lotteryTicketPanel.GetGameDigitCount()];
                for (int seqCtr = 0; seqCtr < lotteryTicketPanel.GetGameDigitCount(); seqCtr++)
                {
                    while (true)
                    {
                        int randomIndex = rnd.Next(0, drawnDigits.Count); //intentionally didnt minus 1
                        int anyDigit    = drawnDigits[randomIndex];
                        if (anyDigit <= 0)
                        {
                            anyDigit = 1;
                        }
                        if (!result.Contains(anyDigit))
                        {
                            result[seqCtr] = anyDigit;
                            break;
                        }
                    }
                }
                Array.Sort(result);
                sequenceArr.Add(result);
            }

            return(sequenceArr);
        }
Esempio n. 3
0
        public List <int[]> GenerateSequence()
        {
            LotteryTicketPanel lotteryTicketPanel = lotteryDataServices.GetLotteryTicketPanel();

            int[] topDrawnNumbersArr = lotteryDataServices.GetTopDrawnResultDigits().ToArray();

            List <int[]> sequenceArr  = new List <int[]>();
            Random       rnd          = new Random();
            int          breakInfLoop = 0;

            for (int ctr = 0; ctr < GetFieldParamValueForCount(); ctr++)
            {
                breakInfLoop = 0;
                int[] result = new int[lotteryTicketPanel.GetGameDigitCount()];
                while (true)
                {
                    for (int seqCtr = 0; seqCtr < lotteryTicketPanel.GetGameDigitCount(); seqCtr++)
                    {
                        while (true)
                        {
                            int anyDigit    = rnd.Next(0, topDrawnNumbersArr.Length);
                            int pickupDigit = topDrawnNumbersArr[anyDigit];
                            if (!result.Contains(pickupDigit))
                            {
                                result[seqCtr] = pickupDigit;
                                break;
                            }
                            if (breakInfLoop++ > 100000)
                            {
                                break;
                            }
                        }
                    }
                    int sum = 0;
                    foreach (int i in result)
                    {
                        sum += i;
                    }
                    if (sum >= IN_BETWEEN_SUM_MIN && sum <= IN_BETWEEN_SUM_MAX)
                    {
                        break;
                    }
                    result = new int[lotteryTicketPanel.GetGameDigitCount()];

                    if (breakInfLoop++ > 100000)
                    {
                        break;
                    }
                }
                if (breakInfLoop++ > 100000)
                {
                    break;
                }
                Array.Sort(result);
                sequenceArr.Add(result);
            }
            return(sequenceArr);
        }
Esempio n. 4
0
 public ModifyBetFrm(LotteryDataServices lotteryDataServices)
 {
     InitializeComponent();
     this.lotteryDataServices          = lotteryDataServices;
     this.lotteryTicketPanel           = this.lotteryDataServices.GetLotteryTicketPanel();
     this.lotteryOutletList            = this.lotteryDataServices.GetLotteryOutlets();
     this.lotterySequenceGeneratorList = this.lotteryDataServices.GetAllSequenceGenerators();
     InitializesForms();
 }
Esempio n. 5
0
 public DrawAndBetMatchFrm(LotteryDataServices lotteryDataServices, DateTime betDateTime, long betIdDefault = 0)
 {
     InitializeComponent();
     this.betDateTime         = betDateTime;
     this.lotteryDataServices = lotteryDataServices;
     this.betIdDefault        = betIdDefault;
     this.lotteryTicketPanel  = this.lotteryDataServices.GetLotteryTicketPanel();
     SetupForms();
     InitialzesContents();
 }
        public List <int[]> GenerateSequence()
        {
            LotteryTicketPanel lotteryTicketPanel = lotteryDataServices.GetLotteryTicketPanel();
            List <int[]>       sequenceArr        = new List <int[]>();
            Random             rnd = new Random();

            for (int ctr = 0; ctr < GetFieldParamValueForCount(); ctr++)
            {
                sequenceArr.Add(LuckyPickGenerator(rnd));
            }
            return(sequenceArr);
        }
Esempio n. 7
0
 public ModifyBetDateFrm(LotteryDataServices lotteryDataServices)
 {
     InitializeComponent();
     this.lotteryDataServices     = lotteryDataServices;
     this.lotteryTicketPanel      = this.lotteryDataServices.GetLotteryTicketPanel();
     this.lotteryOutletArr        = this.lotteryDataServices.GetLotteryOutlets();
     this.lotterySchedule         = this.lotteryDataServices.GetLotterySchedule();
     this.autoSelectBetList       = new List <long>();
     this.autoSelectBetLowestDate = DateTime.Now;
     InitializesFormLabels();
     InitializesListViewColumns();
 }
        public ModifyClaimsFrm(LotteryDataServices lotteryDataServices)
        {
            InitializeComponent();
            this.lotteryDataServices = lotteryDataServices;

            //Debugging
            //if(lotteryDataServices==null)
            //    this.lotteryDataServices = new LotteryDataServices(new Game658());
            //end debugging

            this.lotteryTicketPanel = this.lotteryDataServices.GetLotteryTicketPanel();
            InitializesForms();
        }
 public AddBetFrm(LotteryDataServices lotteryDataServices)
 {
     InitializeComponent();
     this.lotteryDataServices = lotteryDataServices;
     this.lotteryTicketPanel  = this.lotteryDataServices.GetLotteryTicketPanel();
     this.lotteryOutletArr    = this.lotteryDataServices.GetLotteryOutlets();
     this.lotterySchedule     = this.lotteryDataServices.GetLotterySchedule();
     this.lotterySeqGenArr    = this.lotteryDataServices.GetAllSequenceGenerators();
     SetupForm();
     //need to place it here so that other form calling this form may preset the combo box before showing the form
     cmbOutlet.Items.AddRange(lotteryOutletArr.ToArray());
     cmbSeqGenType.Items.AddRange(lotterySeqGenArr.ToArray());
     GenerateTicketPanelNumbers();
 }
        public List <int[]> GenerateSequence()
        {
            List <int>         hasntYetPickUp     = new List <int>();
            List <int>         topDraw            = lotteryDataServices.GetTopDrawnResultDigits();
            LotteryTicketPanel lotteryTicketPanel = lotteryDataServices.GetLotteryTicketPanel();

            for (int ctr = 1; ctr <= lotteryTicketPanel.GetMax(); ctr++)
            {
                if (!topDraw.Contains(ctr))
                {
                    hasntYetPickUp.Add(ctr);
                }
            }
            return(GroupAndCountAndSlice(hasntYetPickUp.ToArray()));
        }
Esempio n. 11
0
        public LotterySettingsFrm(LotteryDataServices lotteryDataServices)
        {
            InitializeComponent();

            if (lotteryDataServices != null)
            {
                this.lotteryDataServices = lotteryDataServices;
                this.lotteryTicketPanel  = this.lotteryDataServices.GetLotteryTicketPanel();
            }
            this.lotteryAppConfiguration = LotteryAppConfiguration.GetInstance();
            txtConfigDBSource.Text       = this.lotteryAppConfiguration.DBSourcePath;
            txtConfigFolderML.Text       = this.lotteryAppConfiguration.MLModelPath;
            txtConfigNotes.Text          = String.Format(ResourcesUtils.GetMessage("lott_app_config_notes"),
                                                         Environment.NewLine + Environment.NewLine, Environment.NewLine + Environment.NewLine,
                                                         Environment.NewLine + Environment.NewLine, Environment.NewLine + Environment.NewLine);
        }
        public List <int[]> GenerateSequence()
        {
            LotteryTicketPanel lotteryTicketPanel = lotteryDataServices.GetLotteryTicketPanel();
            List <int[]>       sequenceArr        = new List <int[]>();
            Random             rnd = new Random();

            for (int ctr = 0; ctr < GetFieldParamValueForCount(); ctr++)
            {
                int[] result = new int[lotteryTicketPanel.GetGameDigitCount()];
                while (true)
                {
                    for (int seqCtr = 0; seqCtr < lotteryTicketPanel.GetGameDigitCount(); seqCtr++)
                    {
                        while (true)
                        {
                            int anyDigit = rnd.Next(1, 32);
                            if (anyDigit <= 0)
                            {
                                anyDigit = 1;
                            }
                            if (!result.Contains(anyDigit))
                            {
                                result[seqCtr] = anyDigit;
                                break;
                            }
                        }
                    }
                    int sum = 0;
                    foreach (int i in result)
                    {
                        sum += i;
                    }
                    if (sum >= IN_BETWEEN_SUM_MIN && sum <= IN_BETWEEN_SUM_MAX)
                    {
                        break;
                    }
                    result = new int[lotteryTicketPanel.GetGameDigitCount()];
                }
                Array.Sort(result);
                sequenceArr.Add(result);
            }
            return(sequenceArr);
        }
Esempio n. 13
0
        public List <int[]> GenerateSequence()
        {
            LotteryTicketPanel lotteryTicketPanel = lotteryDataServices.GetLotteryTicketPanel();
            List <LotteryBet>  betsThisSeason     = lotteryDataServices.GetLotteryBetsCurrentSeason();
            List <int>         merge     = new List <int>();
            List <int>         rawResult = new List <int>();

            foreach (LotteryBet bet in betsThisSeason)
            {
                merge.AddRange(bet.GetAllNumberSequence());
            }

            for (int ctr = lotteryTicketPanel.GetMin(); ctr < lotteryTicketPanel.GetMax(); ctr++)
            {
                if (!merge.Contains(ctr))
                {
                    rawResult.Add(ctr);
                }
            }

            int[] result = rawResult.ToArray();
            Array.Sort(result);
            return(GroupAndCountAndSlice(result));
        }
 protected AbstractSequenceGenerator(LotteryDataServices lotteryDataServices) : base()
 {
     this.lotteryDataServices = lotteryDataServices;
     this.lotteryTicketPanel  = this.lotteryDataServices.GetLotteryTicketPanel();
 }
Esempio n. 15
0
 public PickGeneratorFrm(LotteryDataServices lotteryDataServices)
 {
     InitializeComponent();
     this.lotteryDataServices = lotteryDataServices;
     this.lotteryTicketPanel  = this.lotteryDataServices.GetLotteryTicketPanel();
 }