I have a list of classes/objects and I need to get a random item from the list. In a particular case, I need to take a random item from a specific range OR a specific index. Meaning it's not just a
Item item = List[Random.Next(2,10)]; //take one random item between index 2 and index 9
(to make an example) but I'd need something like "the random value must be between 2 and 9 (like in the example) OR be 15". I just need to add also the index 15 to the random range. So, is there a simple way to choose different ranges instead of only one range without creating a new List with the items I need? Always for that matter, is there a way to exclude some values from the base range (2,9)?
I would increase range and use additional value as exception: