Exemplo n.º 1
0
 private static void Add(NumberModel item, ref List <NumberModel> numberModels)
 {
     if (numberModels.Count(S => S.N1 == item.N1 && S.N2 == item.N2 && S.N3 == item.N3 && S.N4 == item.N4) == 0)
     {
         numberModels.Add(item);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// 生成所有号码
        /// </summary>
        /// <returns></returns>
        public static List <NumberModel> GetAllNumer()
        {
            List <NumberModel> allnumber = new List <NumberModel>();



            string h1 = string.Empty;
            string h2 = string.Empty;
            string h3 = string.Empty;
            string h4 = string.Empty;



            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 10; j++)
                {
                    for (int k = 0; k < 10; k++)
                    {
                        for (int l = 0; l < 10; l++)
                        {
                            NumberModel number = new NumberModel();
                            number.N1 = i;
                            number.N2 = j;
                            number.N3 = k;
                            number.N4 = l;
                            allnumber.Add(number);
                        }
                    }
                }
            }
            return(allnumber);
        }
Exemplo n.º 3
0
 public static bool Same(NumberModel n1, NumberModel n2)
 {
     if (n1.N1 == n2.N1 && n1.N2 == n2.N2 && n1.N3 == n2.N3 && n1.N4 == n2.N4)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 4
0
 public void Del(NumberModel model)
 {
     if (delnumber.Where(S => S.N1 == model.N1 && S.N2 == model.N2 && S.N3 == model.N3 && S.N4 == model.N4).ToList().Count > 0)
     {
         return;
     }
     delnumber.Add(model);
 }
Exemplo n.º 5
0
 /// <summary>
 /// 是否全是大数
 /// </summary>
 /// <param name="lastnumber"></param>
 /// <returns></returns>
 public static bool CheckSmall(NumberModel lastnumber)
 {
     if (lastnumber.N1 >= 5 && lastnumber.N2 >= 5 && lastnumber.N3 >= 5 && lastnumber.N4 >= 5)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 6
0
 /// <summary>
 /// 是否全是小数
 /// </summary>
 /// <param name="lastnumber"></param>
 /// <returns></returns>
 public static bool CheckBig(NumberModel lastnumber)
 {
     if (lastnumber.N1 < 5 && lastnumber.N2 < 5 && lastnumber.N3 < 5 && lastnumber.N4 < 5)
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 7
0
 /// <summary>
 /// 是否全是奇数
 /// </summary>
 /// <param name="lastnumber"></param>
 /// <returns></returns>
 public static bool ChecNotkOdd(NumberModel lastnumber)
 {
     if (NotOdd(lastnumber.N1) && NotOdd(lastnumber.N2) && NotOdd(lastnumber.N3) && NotOdd(lastnumber.N4))
     {
         return(true);
     }
     return(false);
 }
Exemplo n.º 8
0
        public static NumberModel ToParse(string val)
        {
            val = val.Trim(' ').Trim('\r').Trim('\n');
            char[] chart = val.ToCharArray();


            NumberModel number = new NumberModel();

            number.N1 = int.Parse(chart[0].ToString());
            number.N2 = int.Parse(chart[1].ToString());
            number.N3 = int.Parse(chart[2].ToString());
            number.N4 = int.Parse(chart[3].ToString());

            return(number);
        }
Exemplo n.º 9
0
        private void button37_Click(object sender, EventArgs e)
        {
            string[] strarray = this.tb_lajihao.Text.Split(',');

            if (strarray.Length <= 0)
            {
                MessageBox.Show("请填写删除的垃圾号,以逗号分割");
                return;
            }

            for (int i = 0; i < strarray.Length; i++)
            {
                NumberModel n = NumberModel.ToParse(strarray[i]);
                Del(n);
            }

            Print();
        }
Exemplo n.º 10
0
        private void CheckDelNumer()
        {
            DelnumberModels.Clear();

            #region 特殊杀号
            if (ck_ABCD.Checked)
            {
                Rule.Teshuhao.ABCD(ref DelnumberModels);
            }

            if (ck_AABC.Checked)
            {
                Teshuhao.AABC(ref DelnumberModels);
            }
            if (ck_AABB.Checked)
            {
                Teshuhao.AABB(ref DelnumberModels);
            }

            if (ck_AAAB.Checked)
            {
                Teshuhao.AAAB(ref DelnumberModels);
            }
            if (ck_AAAA.Checked)
            {
                Teshuhao.AAAA(ref DelnumberModels);
            }
            if (ck_不连.Checked)
            {
                Teshuhao.连(ref DelnumberModels);
            }
            if (ck_2个顺子.Checked)
            {
                Teshuhao.两个顺子(ref DelnumberModels);
            }

            if (ck_兄弟号.Checked)
            {
                Teshuhao.兄弟号(ref DelnumberModels);
            }

            if (ck_非兄弟号.Checked)
            {
                Teshuhao.非兄弟号(ref DelnumberModels);
            }
            if (ck_全大.Checked)
            {
                Teshuhao.全大(ref DelnumberModels);
            }
            if (ck_全小.Checked)
            {
                Teshuhao.全小(ref DelnumberModels);
            }
            if (ck_全奇.Checked)
            {
                Teshuhao.全奇(ref DelnumberModels);
            }
            if (ck_全偶.Checked)
            {
                Teshuhao.全偶(ref DelnumberModels);
            }
            if (ck_对数.Checked)
            {
                Teshuhao.对数(ref DelnumberModels);
            }
            if (ck_杀05.Checked)
            {
                Teshuhao.M05对数(ref DelnumberModels);
            }
            if (ck_杀16.Checked)
            {
                Teshuhao.M16对数(ref DelnumberModels);
            }
            if (ck_杀27.Checked)
            {
                Teshuhao.M27对数(ref DelnumberModels);
            }
            if (ck_杀38.Checked)
            {
                Teshuhao.M38对数(ref DelnumberModels);
            }
            if (ck_杀49.Checked)
            {
                Teshuhao.M49对数(ref DelnumberModels);
            }

            #region 杀指定连号

            if (ck_杀01.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 0, 1);
            }
            if (ck_杀12.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 1, 2);
            }
            if (ck_杀23.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 2, 3);
            }
            if (ck_杀34.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 3, 4);
            }
            if (ck_杀45.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 4, 5);
            }
            if (ck_杀56.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 5, 6);
            }
            if (ck_杀67.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 6, 7);
            }

            if (ck_杀78.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 7, 8);
            }
            if (ck_杀89.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 8, 9);
            }
            if (ck_杀90.Checked)
            {
                Teshuhao.杀两位固定数(ref DelnumberModels, 9, 0);
            }



            if (ck_杀012.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 0, 1, 2);
            }
            if (ck_杀123.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 1, 2, 3);
            }
            if (ck_杀234.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 2, 3, 4);
            }

            if (ck_杀345.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 3, 4, 5);
            }
            if (ck_杀456.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 4, 5, 6);
            }
            if (ck_杀567.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 5, 6, 7);
            }

            if (ck_杀678.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 6, 7, 8);
            }
            if (ck_杀789.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 7, 8, 9);
            }
            if (ck_杀890.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 8, 9, 0);
            }
            if (ck_杀901.Checked)
            {
                Teshuhao.杀三位固定数(ref DelnumberModels, 9, 0, 1);
            }

            #endregion

            if (ck_杀00.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 0);
            }
            if (ck_杀11.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 1);
            }
            if (ck_杀22.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 2);
            }
            if (ck_杀33.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 3);
            }
            if (ck_杀44.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 4);
            }
            if (ck_杀55.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 5);
            }
            if (ck_杀66.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 6);
            }
            if (ck_杀77.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 7);
            }
            if (ck_杀88.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 8);
            }
            if (ck_杀99.Checked)
            {
                Teshuhao.杀两重号(ref DelnumberModels, 9);
            }

            #region 杀指定双重号
            #endregion

            #endregion

            #region 点杀区域


            if (ck_点杀大小.Checked && !string.IsNullOrEmpty(this.tb_点杀大小.Text))
            {
                string[] array = this.tb_点杀大小.Text.Split(',');
                Diansha.大小enter(array, ref DelnumberModels);
            }

            if (ck_点杀奇偶.Checked && !string.IsNullOrEmpty(this.tb_点杀奇偶.Text))
            {
                string[] array = this.tb_点杀奇偶.Text.Split(',');
                Diansha.奇偶enter(array, ref DelnumberModels);
            }

            if (ck_点杀质合.Checked && !string.IsNullOrEmpty(this.tb_点杀质合.Text))
            {
                string[] array = this.tb_点杀质合.Text.Split(',');
                Diansha.质合enter(array, ref DelnumberModels);
            }
            if (ck_点杀012.Checked && !string.IsNullOrEmpty(this.tb_点杀012.Text))
            {
                string[] array = this.tb_点杀012.Text.Split(',');
                Diansha.L012enter(array, ref DelnumberModels);
            }
            if (ck_垃圾号.Checked && !string.IsNullOrEmpty(this.tb_垃圾号.Text))
            {
                string[] array = this.tb_垃圾号.Text.Split(' ');

                List <NumberModel> list = new List <NumberModel>();

                foreach (var n in array)
                {
                    if (!string.IsNullOrEmpty(n.Trim(' ').Trim('\r').Trim('\n')))
                    {
                        NumberModel number = NumberModel.ToParse(n);
                        list.Add(number);
                    }
                }
                lajihao.Enter(list, ref DelnumberModels);
            }


            #endregion

            #region 和值区域

            if (ck_四位和值.Checked && !string.IsNullOrEmpty(tb_四位和值.Text))
            {
                string[] array = this.tb_四位和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.四位和值(iNums, ref DelnumberModels);
            }


            if (ck_前三和值.Checked && !string.IsNullOrEmpty(tb_前三和值.Text))
            {
                string[] array = this.tb_前三和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.前三和值(iNums, ref DelnumberModels);
            }
            if (ck_后三和值.Checked && !string.IsNullOrEmpty(tb_后三和值.Text))
            {
                string[] array = this.tb_后三和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.后三和值(iNums, ref DelnumberModels);
            }

            if (ck_前二和值.Checked && !string.IsNullOrEmpty(tb_前二和值.Text))
            {
                string[] array = this.tb_前二和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.前二和值(iNums, ref DelnumberModels);
            }
            if (ck_中二和值.Checked && !string.IsNullOrEmpty(tb_中二和值.Text))
            {
                string[] array = this.tb_中二和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.中二和值(iNums, ref DelnumberModels);
            }
            if (ck_后二和值.Checked && !string.IsNullOrEmpty(tb_后二和值.Text))
            {
                string[] array = this.tb_后二和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.后二和值(iNums, ref DelnumberModels);
            }
            if (ck_千百个和值.Checked && !string.IsNullOrEmpty(tb_千百个和值.Text))
            {
                string[] array = this.tb_千百个和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.千百个和值(iNums, ref DelnumberModels);
            }
            if (ck_千十个和值.Checked && !string.IsNullOrEmpty(tb_千十个和值.Text))
            {
                string[] array = this.tb_千十个和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.千十个和值(iNums, ref DelnumberModels);
            }


            if (ck_奇数和值.Checked && !string.IsNullOrEmpty(tb_奇数和值.Text))
            {
                string[] array = this.tb_奇数和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.奇数和值(iNums, ref DelnumberModels);
            }
            if (ck_偶数和值.Checked && !string.IsNullOrEmpty(tb_偶数和值.Text))
            {
                string[] array = this.tb_偶数和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.偶数和值(iNums, ref DelnumberModels);
            }

            if (ck_千个和值.Checked && !string.IsNullOrEmpty(tb_千个和值.Text))
            {
                string[] array = this.tb_千个和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.千个和值(iNums, ref DelnumberModels);
            }
            if (ck_千十和值.Checked && !string.IsNullOrEmpty(tb_千十和值.Text))
            {
                string[] array = this.tb_千十和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.千十和值(iNums, ref DelnumberModels);
            }
            if (ck_百个和值.Checked && !string.IsNullOrEmpty(tb_百个和值.Text))
            {
                string[] array = this.tb_百个和值.Text.Split(',');
                int[]    iNums = Array.ConvertAll(array, int.Parse);

                hezhishahao.百个和值(iNums, ref DelnumberModels);
            }

            #endregion

            #region 杀定位区域

            if (ck_杀定位.Checked)
            {
                List <int> qian = new List <int>();
                List <int> bai  = new List <int>();
                List <int> shi  = new List <int>();
                List <int> ge   = new List <int>();

                foreach (var item in panel_qian.Controls)
                {
                    if (item is CheckBox)
                    {
                        CheckBox cb = (CheckBox)item;
                        if (cb.Checked)
                        {
                            qian.Add(int.Parse(cb.Text));
                        }
                    }
                }
                foreach (var item in panel_bai.Controls)
                {
                    if (item is CheckBox)
                    {
                        CheckBox cb = (CheckBox)item;
                        if (cb.Checked)
                        {
                            bai.Add(int.Parse(cb.Text));
                        }
                    }
                }
                foreach (var item in panel_shi.Controls)
                {
                    if (item is CheckBox)
                    {
                        CheckBox cb = (CheckBox)item;
                        if (cb.Checked)
                        {
                            shi.Add(int.Parse(cb.Text));
                        }
                    }
                }
                foreach (var item in panel_ge.Controls)
                {
                    if (item is CheckBox)
                    {
                        CheckBox cb = (CheckBox)item;
                        if (cb.Checked)
                        {
                            ge.Add(int.Parse(cb.Text));
                        }
                    }
                }
                shadingwei.Enter(qian, bai, shi, ge, ref DelnumberModels);
            }



            #endregion



            #region 杀连号

            if (ck_无序2连.Checked)
            {
                shalianhao.无序2连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }
            if (ck_无序3连.Checked)
            {
                shalianhao.无序3连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }
            if (ck_无序4连.Checked)
            {
                shalianhao.无序4连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }



            if (ck_正向2连.Checked)
            {
                shalianhao.正向2连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }
            if (ck_正向3连.Checked)
            {
                shalianhao.正向3连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }
            if (ck_正向4连.Checked)
            {
                shalianhao.正向4连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }


            if (ck_反向2连.Checked)
            {
                shalianhao.反向2连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }
            if (ck_反向3连.Checked)
            {
                shalianhao.反向3连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }
            if (ck_反向4连.Checked)
            {
                shalianhao.反向4连(this.ck_首尾相连.Checked, this.ck_09相连.Checked, ref DelnumberModels);
            }

            #endregion


            #region 两数和值

            if (ck_两数和值.Checked && !string.IsNullOrEmpty(tb_两数和值.Text))
            {
                string[]   array = this.tb_两数和值.Text.Split(',');
                int[]      iNums = Array.ConvertAll(array, int.Parse);
                List <int> list  = iNums.ToList();
                dingliangshuhezhi.两数和值(list, ref DelnumberModels);
            }

            if (ck_三数和值.Checked && !string.IsNullOrEmpty(tb_三数和值.Text))
            {
                string[]   array = this.tb_三数和值.Text.Split(',');
                int[]      iNums = Array.ConvertAll(array, int.Parse);
                List <int> list  = iNums.ToList();
                dingliangshuhezhi.数和值(list, ref DelnumberModels);
            }

            #endregion


            #region   字现

            if (this.ck_sanzixian.Checked)
            {
                char[] psan = tb_sanzixian.Text.ToCharArray();
                if (psan.Length > 4)
                {
                    MessageBox.Show("上期号码长度大于4");
                    return;
                }
                List <int> sanlist = new List <int>();

                foreach (var item in psan)
                {
                    sanlist.Add(Convert.ToInt32(item.ToString()));
                }

                SanZiXian(sanlist, ref DelnumberModels);
            }


            #endregion



            #region 杀胆码 杀跨度  杀胆必须是最后一项

            if (ck_杀跨度.Checked)
            {
                List <int> kuada = new List <int>();
                foreach (var item in groupBox11.Controls)
                {
                    if (item is CheckBox)
                    {
                        CheckBox cb = (CheckBox)item;
                        if (cb.Checked && cb.Name != "ck_杀跨度")
                        {
                            kuada.Add(int.Parse(cb.Text));
                        }
                    }
                }
                shakuadu.Enter(kuada, ref DelnumberModels);
            }

            if (ck_杀胆码.Checked)
            {
                List <int> danma = new List <int>();
                foreach (var item in groupBox10.Controls)
                {
                    if (item is CheckBox)
                    {
                        CheckBox cb = (CheckBox)item;
                        if (cb.Checked && cb.Name != "ck_杀胆码")
                        {
                            danma.Add(int.Parse(cb.Text));
                        }
                    }
                }
                shadanma.ShaWuYiMa(danma, ref DelnumberModels);
            }



            #endregion
            // 杀胆码必须是最后一项
        }
Exemplo n.º 11
0
        public static bool L0123(NumberModel number, string rule)
        {
            //0路包括的数字:0、3、6、9
            //1路包括的数字:1、4、7
            //2路包括的数字:2、5、8

            int[] L0 = { 0, 3, 6, 9 };
            int[] L1 = { 1, 4, 7 };
            int[] L2 = { 2, 5, 8 };

            char[] rulechar = rule.ToCharArray();

            bool B1 = false, B2 = false, B3 = false, B4 = false;

            if (rulechar[0].ToString() == "0")
            {
                B1 = L0.Contains(number.N1);
            }
            if (rulechar[0].ToString() == "1")
            {
                B1 = L1.Contains(number.N1);
            }
            if (rulechar[0].ToString() == "2")
            {
                B1 = L2.Contains(number.N1);
            }

            if (rulechar[1].ToString() == "0")
            {
                B2 = L0.Contains(number.N2);
            }
            if (rulechar[1].ToString() == "1")
            {
                B2 = L1.Contains(number.N2);
            }
            if (rulechar[1].ToString() == "2")
            {
                B2 = L2.Contains(number.N2);
            }

            if (rulechar[2].ToString() == "0")
            {
                B3 = L0.Contains(number.N3);
            }
            if (rulechar[2].ToString() == "1")
            {
                B3 = L1.Contains(number.N3);
            }
            if (rulechar[2].ToString() == "2")
            {
                B3 = L2.Contains(number.N3);
            }
            if (rulechar[3].ToString() == "0")
            {
                B4 = L0.Contains(number.N4);
            }
            if (rulechar[3].ToString() == "1")
            {
                B4 = L1.Contains(number.N4);
            }
            if (rulechar[3].ToString() == "2")
            {
                B4 = L2.Contains(number.N4);
            }

            return(B1 && B2 && B3 && B4);
        }