Example #1
0
        public void build_history_map()
        {
            LtCounter   couter = new LtCounter();
            List <long> red5s  = new List <long>();

            foreach (LottoryItem item in gridList)
            {
                red5s.Clear();
                long mapTmp = item.map & 0x1FFFFFFFF;
                if (!mapHis6.ContainsKey(mapTmp))
                {
                    mapHis6.Add(mapTmp, item);
                }

                couter.get_6_to_5(mapTmp, red5s);
                for (int i = 0; i < 6; ++i)
                {
                    if (!mapHis5.ContainsKey(red5s[i]))
                    {
                        mapHis5.Add(red5s[i], item);
                    }
                }
            }
        }
Example #2
0
        private void btFindExist_Click(object sender, EventArgs e)
        {
            string numFind = numToFindExist.Text.Trim();

            if (numFind.Length < 2)
            {
                return;
            }

            long ONE      = 1;
            long mapFind  = 0;
            int  redCount = 0;

            int[]    red  = { 0, 0, 0, 0, 0, 0 };
            string[] nums = numFind.Split(' ');
            for (int i = 0; i < 6 && i < nums.Length; ++i)
            {
                red[i] = Int32.Parse(nums[i]);
                if (red[i] < 1 || red[i] > 33)
                {
                    return;
                }
                mapFind |= ONE << (red[i] - 1);
                redCount++;
            }

            //----------------------------------------------
            if (comBoxExistData.SelectedIndex == 0)
            {
                if (gridList.Count < 1)
                {
                    return;
                }

                int[] countIndex = { 0, 0, 0, 0, 0, 0, 0 };
                gridFindExist.DataSource = listFindExist;
                listFindExist.Clear();

                foreach (LottoryItem item in gridList)
                {
                    long tmpMap = mapFind & item.map;
                    tmpMap &= 0x1FFFFFFFF;
                    int same = Combin.bit_count(tmpMap);
                    countIndex[same]++;
                    string numStr = string.Format("{0:00} {1:00} {2:00} {3:00} {4:00} {5:00} {6:00}"
                                                  , item.red[0], item.red[1], item.red[2], item.red[3], item.red[4], item.red[5], item.blue);
                    CountExist countex = new CountExist(item.id, numStr, same);
                    listFindExist.Add(countex);
                }

                for (int i = 0; i < 7; ++i)
                {
                    CountExist countex = new CountExist(i, countIndex[i].ToString(), 10 + i);
                    listFindExist.Add(countex);
                }

                gridViewFindExist.SortInfo.Add(gridViewFindExist.Columns[2], ColumnSortOrder.Descending);
                gridViewFindExist.Focus();
                SendKeys.SendWait("^{HOME}");
            }
            else if (comBoxExistData.SelectedIndex == 1)
            {
                if (listLtTaobao.Count < 1)
                {
                    return;
                }

                int         matchCount = 0;
                LtCounter   count      = new LtCounter();
                List <long> allRed     = new List <long>();
                List <long> red5s      = new List <long>();
                int[]       countIndex = { 0, 0, 0, 0, 0, 0, 0 };
                gridFindExist.DataSource = listFindExist;
                listFindExist.Clear();

                foreach (LtItem item in listLtTaobao)
                {
                    matchCount = 0;
                    if (count.getItem(item.red, allRed) == 0)
                    {
                        foreach (long map in allRed)
                        {
                            int mcount = Combin.bit_count(map & mapFind);
                            if (mcount > matchCount)
                            {
                                matchCount = mcount;
                            }

                            red5s.Clear();
                            long mapTmp = map & 0x1FFFFFFFF;
                            if (!mapTaob6.ContainsKey(mapTmp))
                            {
                                mapTaob6.Add(mapTmp, null);
                            }

                            count.get_6_to_5(mapTmp, red5s);
                            for (int i = 0; i < 6; ++i)
                            {
                                if (!mapTaob5.ContainsKey(red5s[i]))
                                {
                                    mapTaob5.Add(red5s[i], null);
                                }
                            }
                        }
                        countIndex[matchCount]++;
                        CountExist countex = new CountExist(item.user, item.red, matchCount);
                        listFindExist.Add(countex);
                    }
                    allRed.Clear();
                }

                for (int i = 0; i < 7; ++i)
                {
                    CountExist countex = new CountExist(i, countIndex[i].ToString(), 10 + i);
                    listFindExist.Add(countex);
                }

                gridViewFindExist.SortInfo.Add(gridViewFindExist.Columns[2], ColumnSortOrder.Descending);
                gridViewFindExist.Focus();
                SendKeys.SendWait("^{HOME}");
            }
        }
Example #3
0
        private void comBoxLoadTaobaoFileter_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.InitialDirectory = Directory.GetCurrentDirectory();
            if (dlg.ShowDialog() != DialogResult.OK)
            {
                return;
            }

            comBoxLoadTaobaoFileter.Text = dlg.SafeFileName;

            //--------------------------------------------
            string       sLine     = "";
            StreamReader objReader = new StreamReader(dlg.FileName);

            listLtTaobaoFilter.Clear();
            while (sLine != null)
            {
                sLine = objReader.ReadLine();
                if (sLine != null && !sLine.Equals(string.Empty))
                {
                    LtItem item = new LtItem();
                    if (item.fromString(sLine) < 0)
                    {
                        MessageBox.Show("Wrong data: " + sLine);
                        return;
                    }
                    listLtTaobaoFilter.Add(item);
                }
            }
            objReader.Close();


            LtCounter   count  = new LtCounter();
            List <long> allRed = new List <long>();
            List <long> red5s  = new List <long>();

            foreach (LtItem item in listLtTaobaoFilter)
            {
                if (count.getItem(item.red, allRed) == 0)
                {
                    foreach (long map in allRed)
                    {
                        red5s.Clear();
                        long mapTmp = map & 0x1FFFFFFFF;
                        if (!mapTaob6.ContainsKey(mapTmp))
                        {
                            mapTaob6.Add(mapTmp, null);
                        }

                        count.get_6_to_5(mapTmp, red5s);
                        for (int i = 0; i < 6; ++i)
                        {
                            if (!mapTaob5.ContainsKey(red5s[i]))
                            {
                                mapTaob5.Add(red5s[i], null);
                            }
                        }
                    }
                }
                allRed.Clear();
            }
        }
Example #4
0
        private void btDoFileter_Click(object sender, EventArgs e)
        {
            int    randIndex = 0;
            string err       = "";

            btDoFileter.Enabled = false;

            if (!parseFiltOpt(ref err))
            {
                MessageBox.Show(err);
                btDoFileter.Enabled = true;
                return;
            }

            listFilAll.Clear();

            Combin cmb      = new Combin(33, 6);
            long   curMap   = cmb.next();
            int    allIndex = 0;

            int showStep = 5000;
            int prgsStep = (int)cmb.COUNT / showStep;

            progressFilter.Properties.Minimum = 0;
            progressFilter.Properties.Maximum = prgsStep;
            progressFilter.Properties.Step    = 1;
            progressFilter.Position           = 0;
            progressFilter.Refresh();

            LtCounter   count      = new LtCounter();
            List <long> allRed     = new List <long>();
            List <long> red5s      = new List <long>();
            bool        matchOther = false;

            int  his_fil_count = 0;
            int  tao_fil_count = 0;
            long mapExist      = 0;

            int[] redAllCount = new int[36];
            for (int i = 0; i < 36; i++)
            {
                redAllCount[i] = 0;
            }

            while (curMap != 0)
            {
                matchOther = false;
                TinyLott lott = new TinyLott(curMap);
                if (!isMatch(lott))
                {
                    goto FindNext;
                }

                //过滤历史
                red5s.Clear();
                if (his_filter_count > 0)
                {
                    if (his_filter_count == 5)
                    {
                        count.get_6_to_5(curMap, red5s);
                        for (int i = 0; i < 6; ++i)
                        {
                            if (mapHis5.ContainsKey(red5s[i]))
                            {
                                his_fil_count++;
                                goto FindNext;
                            }
                        }
                    }
                    if (his_filter_count == 6 && mapHis6.ContainsKey(curMap))
                    {
                        his_fil_count++;
                        goto FindNext;
                    }
                }

                //过滤淘宝
                if (tao_filter_count > 0)
                {
                    if (tao_filter_count == 5)
                    {
                        count.get_6_to_5(curMap, red5s);
                        for (int i = 0; i < 6; ++i)
                        {
                            if (mapTaob5.ContainsKey(red5s[i]))
                            {
                                tao_fil_count++;
                                goto FindNext;
                            }
                        }
                    }
                    if (tao_filter_count == 6 && mapTaob6.ContainsKey(curMap))
                    {
                        tao_fil_count++;
                        goto FindNext;
                    }
                }

                mapExist |= lott.map;
                listFilAll.Add(lott);
                if (listFilAll.Count % 10 == 0)
                {
                    labelFilterOut.Text = "   " + lott.toString() + "   ";
                    labelFilterOut.Refresh();
                }

                for (int i = 0; i < 6; ++i)
                {
                    redAllCount[lott.red[i]]++;
                }

FindNext:
                curMap = cmb.next();

                allIndex++;
                if (allIndex % showStep == 0)
                {
                    progressFilter.PerformStep();
                    progressFilter.Refresh();
                    //gridBand2.Caption = "  找到 " + listFilAll.Count.ToString() + " 个号码";
                    bt_showcount.Text = listFilAll.Count.ToString();
                    bt_showcount.Refresh();
                    gridFilter.Refresh();
                }
            }

            if (listFilAll.Count > 0)
            {
                randIndex           = random.Next(0, listFilAll.Count);
                labelFilterOut.Text = "   " + listFilAll[randIndex].toString() + "   ";
            }

            bt_showcount.Text = listFilAll.Count.ToString();
            bt_showcount.Refresh();
            progressFilter.Properties.Step = prgsStep;
            progressFilter.Refresh();
            btDoFileter.Enabled = true;


            //-----------------------------------
            gridFindExist.DataSource = listFindExist;
            listFindExist.Clear();
            for (int i = 1; i < 34; ++i)
            {
                CountExist countex = new CountExist(i, " ", redAllCount[i]);
                listFindExist.Add(countex);
            }
            gridViewFindExist.SortInfo.Add(gridViewFindExist.Columns[2], ColumnSortOrder.Descending);
            gridViewFindExist.Focus();
            SendKeys.SendWait("^{HOME}");
        }