Hi,
I'm not completely sure I understand your question.
I don't think there are any Permutation classes in .Net,
but will this code give you what you seek?
Random rand = new Random();
ArrayList numbers = new ArrayList();
int[] permutation = new int[50];
// create a list that holds the numbser 0, 1, 2 ... 49
for(int i = 0; i < permutation.Length; i++)
{
numbers.Add(i);
}
// for each entry in the permutation list
// grab the number from a random position in the number list
for(int i = 0; i < permutation.Length; i++)
{
int o = rand.Next(numbers.Count);
permutation[i] = (int)numbers[o];
numbers.RemoveAt(o);
}
Happy coding!
Morten Wennevik [C# MVP] |