public int PoidsEtoilesTirage(Tirage tirage)
 {
     return(tirage.Etoile1 + tirage.Etoile2);
 }
        public static int[] RepartitionParColonne(Tirage tirage)
        {
            int[] result = new int[10] {
                0, 0, 0, 0, 0, 0, 0, 0, 0, 0
            };
            foreach (var number in new int[] { tirage.Boule1, tirage.Boule2, tirage.Boule3, tirage.Boule4, tirage.Boule5 })
            {
                switch (number)
                {
                case int _ when number.ToString().EndsWith("1"):
                    result[0]++;

                    break;

                case int _ when number.ToString().EndsWith("2"):
                    result[1]++;

                    break;

                case int _ when number.ToString().EndsWith("3"):
                    result[2]++;

                    break;

                case int _ when number.ToString().EndsWith("4"):
                    result[3]++;

                    break;

                case int _ when number.ToString().EndsWith("5"):
                    result[4]++;

                    break;

                case int _ when number.ToString().EndsWith("6"):
                    result[5]++;

                    break;

                case int _ when number.ToString().EndsWith("7"):
                    result[6]++;

                    break;

                case int _ when number.ToString().EndsWith("8"):
                    result[7]++;

                    break;

                case int _ when number.ToString().EndsWith("9"):
                    result[8]++;

                    break;

                case int _ when number.ToString().EndsWith("0"):
                    result[9]++;

                    break;
                }
            }

            return(result);
        }
 public int PoidsBoulesTirage(Tirage tirage)
 {
     return(tirage.Boule1 + tirage.Boule2 + tirage.Boule3 + tirage.Boule4 + tirage.Boule5);
 }
Beispiel #4
0
 public void Add(Tirage tirage)
 {
     ListOfTirages.Add(tirage);
 }