public bool isMatch(TinyLott lott) { if (!((TypeFilt)listRule[0]).match_red(ref lott.red)) { return(false); } if (!((TypeFilt)listRule[1]).match(lott.sum)) { return(false); } if (!((TypeFilt)listRule[2]).match(lott.ac)) { return(false); } if (!((TypeFilt)listRule[3]).match(lott.sd)) { return(false); } if (!((TypeFilt)listRule[4]).match(lott.odd)) { return(false); } if (!((TypeFilt)listRule[5]).match(lott.miss)) { return(false); } return(true); }
public TypeFiltOut(TinyLott ltt) { this.num = ""; for (int i = 0; i < 6; i++) { this.num += string.Format("{0:00} ", ltt.red[i]); } this.sum = ltt.sum; this.ac = ltt.ac; this.sd = ltt.sd; this.ou = ltt.odd; }
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}"); }