manuel0081 ha scritto:
estrarre tutti i numeri in un range
Se ho ben capito vuoi ordinare casualmente la collection, giusto?
Se è così puoi usare una cosa di questo tipo:
private static readonly Random random = new Random();
public static List<T> Shuffle(List<T> list)
{
List<T> l = new List<T>(list);
for (int i = l.Count - 1; i > 1; --i)
{
int pos = random.Next(0, i);
T item = l[i];
l[i] = l[pos]; // move random num to end of list.
l[pos] = item;
}
return l;
}
HTH