Ejemplo n.º 1
0
            public override string BuildNumber(int Num)	//id = 21
            {
                System.Random rd = new Random();
                StringBuilder sb = new StringBuilder();
                ArrayList al = new ArrayList();

                for (int i = 0; i < Num; i++)
                {
                    al.Clear();
                    for (int j = 0; j < 5; j++)
                    {
                        int Ball = 0;
                        while ((Ball == 0) || isExistBall(al, Ball))
                            Ball = rd.Next(1, 15 + 1);
                        al.Add(Ball.ToString().PadLeft(2, '0'));
                    }

                    CompareToAscii compare = new CompareToAscii();
                    al.Sort(compare);

                    string LotteryNumber = "";
                    for (int j = 0; j < al.Count; j++)
                        LotteryNumber += al[j].ToString() + " ";

                    sb.Append(LotteryNumber.Trim() + "\n");
                }

                string Result = sb.ToString();
                Result = Result.Substring(0, Result.Length - 1);
                return Result;
            }
Ejemplo n.º 2
0
            public override string BuildNumber(int Num, int Type)//  Type: 8 = 选8,7 = 选7,6 = 选6,5 = 选5, 4 = 选4,3 = 选3,2 = 选2,1 = 选1 
            {
                if ((Type != 8) && (Type != 7) && (Type != 6) && (Type != 5) && (Type != 4) && (Type != 3) && (Type != 2) && (Type != 1))
                    Type = 8;

                System.Random rd = new Random();
                StringBuilder sb = new StringBuilder();
                ArrayList al = new ArrayList();

                for (int i = 0; i < Num; i++)
                {
                    string LotteryNumber = "";
                    for (int j = 0; j < Type; j++)
                    {
                        int Ball = 0;
                        while ((Ball == 0) || isExistBall(al, Ball))
                            Ball = rd.Next(1, 80 + 1);
                        al.Add(Ball.ToString().PadLeft(2, '0'));
                    }
                    CompareToAscii compare = new CompareToAscii();
                    al.Sort(compare);

                    for (int j = 0; j < al.Count; j++)
                        LotteryNumber += al[j].ToString() + " ";

                    sb.Append(LotteryNumber.Trim() + "\n");
                }

                string Result = sb.ToString();
                Result = Result.Substring(0, Result.Length - 1);
                return Result;
            }
Ejemplo n.º 3
0
            public override string BuildNumber(int Num) //id = 13
            {
                System.Random rd = new Random();
                StringBuilder sb = new StringBuilder();
                ArrayList     al = new ArrayList();

                for (int i = 0; i < Num; i++)
                {
                    al.Clear();
                    int Ball;
                    for (int j = 0; j < 7; j++)
                    {
                        Ball = 0;
                        while ((Ball == 0) || isExistBall(al, Ball))
                        {
                            Ball = rd.Next(1, 30 + 1);
                        }
                        al.Add(Ball.ToString().PadLeft(2, '0'));
                    }

                    CompareToAscii compare = new CompareToAscii();
                    al.Sort(compare);

                    string LotteryNumber = "";
                    for (int j = 0; j < al.Count; j++)
                    {
                        LotteryNumber += al[j].ToString() + " ";
                    }

                    sb.Append(LotteryNumber.Trim() + "\n");
                }

                string Result = sb.ToString();

                Result = Result.Substring(0, Result.Length - 1);
                return(Result);
            }
Ejemplo n.º 4
0
Archivo: SSQ.cs Proyecto: ichari/ichari
            private string[] FilterRepeated(string[] NumberPart1, string[] NumberPart2)
            {
                ArrayList al2 = new ArrayList();
                for (int i = 0; i < NumberPart2.Length; i++)
                {
                    al2.Add(NumberPart2[i]);
                }

                ArrayList al1 = new ArrayList();
                for (int i = 0; i < NumberPart1.Length; i++)
                {
                    int Ball = Shove._Convert.StrToInt(NumberPart1[i], -1);
                    if (!isExistBall(al2, Ball))
                        al1.Add(NumberPart1[i]);
                }

                CompareToAscii compare = new CompareToAscii();
                al1.Sort(compare);

                string[] Result = new string[al1.Count];
                for (int i = 0; i < al1.Count; i++)
                    Result[i] = al1[i].ToString().PadLeft(2, '0');

                return Result;
            }
Ejemplo n.º 5
0
Archivo: SSQ.cs Proyecto: ichari/ichari
            private string[] FilterRepeated(string[] NumberPart, int MaxBall)
            {
                ArrayList al = new ArrayList();
                for (int i = 0; i < NumberPart.Length; i++)
                {
                    int Ball = Shove._Convert.StrToInt(NumberPart[i], -1);
                    if ((Ball >= 1) && (Ball <= MaxBall) && (!isExistBall(al, Ball)))
                        al.Add(NumberPart[i]);
                }

                CompareToAscii compare = new CompareToAscii();
                al.Sort(compare);

                string[] Result = new string[al.Count];
                for (int i = 0; i < al.Count; i++)
                    Result[i] = al[i].ToString().PadLeft(2, '0');

                return Result;
            }
Ejemplo n.º 6
0
 private string[] FilterRepeated(string[] NumberPart1, string[] NumberPart2)
 {
     ArrayList al = new ArrayList();
     for (int i = 0; i < NumberPart2.Length; i++)
     {
         al.Add(NumberPart2[i]);
     }
     ArrayList list2 = new ArrayList();
     for (int j = 0; j < NumberPart1.Length; j++)
     {
         int ball = _Convert.StrToInt(NumberPart1[j], -1);
         if (!this.isExistBall(al, ball))
         {
             list2.Add(NumberPart1[j]);
         }
     }
     CompareToAscii comparer = new CompareToAscii();
     list2.Sort(comparer);
     string[] strArray = new string[list2.Count];
     for (int k = 0; k < list2.Count; k++)
     {
         strArray[k] = list2[k].ToString().PadLeft(2, '0');
     }
     return strArray;
 }
Ejemplo n.º 7
0
 private string[] FilterRepeated(string[] NumberPart)
 {
     ArrayList al = new ArrayList();
     for (int i = 0; i < NumberPart.Length; i++)
     {
         int ball = _Convert.StrToInt(NumberPart[i], -1);
         if (((ball >= 1) && (ball <= 11)) && !this.isExistBall(al, ball))
         {
             al.Add(NumberPart[i]);
         }
     }
     CompareToAscii comparer = new CompareToAscii();
     al.Sort(comparer);
     string[] strArray = new string[al.Count];
     for (int j = 0; j < al.Count; j++)
     {
         strArray[j] = al[j].ToString().PadLeft(2, '0');
     }
     return strArray;
 }
Ejemplo n.º 8
0
            public override string BuildNumber(int Red, int Blue, int Num)	//id = 39
            {
                System.Random rd = new Random();
                StringBuilder sb = new StringBuilder();
                ArrayList al_r = new ArrayList();
                ArrayList al_b = new ArrayList();

                for (int i = 0; i < Num; i++)
                {
                    al_r.Clear();
                    al_b.Clear();
                    for (int j = 0; j < Red; j++)
                    {
                        int Ball = 0;
                        while ((Ball == 0) || isExistBall(al_r, Ball))
                            Ball = rd.Next(1, 35 + 1);
                        al_r.Add(Ball.ToString().PadLeft(2, '0'));
                    }

                    for (int j = 0; j < Blue; j++)
                    {
                        int Ball = 0;
                        while ((Ball == 0) || isExistBall(al_b, Ball))
                            Ball = rd.Next(1, 12 + 1);
                        al_b.Add(Ball.ToString().PadLeft(2, '0'));
                    }

                    CompareToAscii compare = new CompareToAscii();
                    al_r.Sort(compare);
                    al_b.Sort(compare);

                    string LotteryNumber = "";
                    for (int j = 0; j < al_r.Count; j++)
                    {
                        LotteryNumber += al_r[j].ToString() + " ";
                    }

                    if (LotteryNumber != "")
                    {
                        LotteryNumber += "+ ";
                    }

                    for (int j = 0; j < al_b.Count; j++)
                    {
                        LotteryNumber += al_b[j].ToString() + " ";
                    }

                    sb.Append(LotteryNumber.Trim() + "\n");
                }

                string Result = sb.ToString();
                Result = Result.Substring(0, Result.Length - 1);
                return Result;
            }