示例#1
0
 private void GenerateRandomLottoNumbers()
 {
     RandomNumbers.Clear();
     while (RandomNumbers.Count < numberOfLottoNumbers)
     {
         int nextNumber = Randomizer.Next(lowerBound, lottoNumberUpperBound + 1);
         while (RandomNumbers.Contains(nextNumber))
         {
             nextNumber = Randomizer.Next(lowerBound, lottoNumberUpperBound + 1);
         }
         RandomNumbers.Add(nextNumber);
     }
 }