using System; using System.Globalization; using System.Linq; using System.Collections.Generic; public class Test { public static T[] UniqueRandomArray(T[] input, Random rnd) { if (input.Length <= 1) throw new ArgumentException("Input array must have at least two elements, otherwise the output would be the same.", "input"); IEnumerable rndSeq; while (input.SequenceEqual(rndSeq = input.OrderBy(x => rnd.Next()))); return rndSeq.ToArray(); } public static void Main() { Random rnd = new Random(); List randomArrays = new List(); int[] arrayInt1 = { 1, 2, 3, 4, 5, 6, 7 }; randomArrays.Add(arrayInt1); for (int i = 0; i < 10; i++) { int[] lastArray = randomArrays[randomArrays.Count - 1]; int[] randomArray = UniqueRandomArray(lastArray, rnd); randomArrays.Add(randomArray); } foreach(int[] array in randomArrays) Console.WriteLine(String.Join(",",array.Select(i=>i.ToString()).ToArray())); } }