using System; using System.Globalization; using System.Linq; using System.Collections.Generic; public class Test { public struct Trio { public int Value1 { get; set; } public int Value2 { get; set; } public int Value3 { get; set; } } public static void Main() { List A = new List { 1, 2, 3, 6 }; List B = new List { 4, 5, 6, 8 }; List C = new List { 7, 8, 9, 33 }; var aShuffle = new List(A.Count); aShuffle.AddRange(A.Shuffle()); var bShuffle = new List(B.Count); bShuffle.AddRange(B.Shuffle()); var cShuffle = new List(C.Count); cShuffle.AddRange(C.Shuffle()); List trios = new List(aShuffle.Count); for (int i = 0; i < aShuffle.Count; i++) { trios.Add(new Trio { Value1 = aShuffle[i], Value2 = bShuffle[i], Value3 = cShuffle[i] }); } foreach(Trio trio in trios) Console.WriteLine("Value1: {0} Value2: {1} Value3: {2}", trio.Value1,trio.Value2,trio.Value3); } } public static class Extensions { public static IEnumerable Shuffle(this IEnumerable source) { return source.Shuffle(new Random()); } public static IEnumerable Shuffle(this IEnumerable source, Random rng) { if (source == null) throw new ArgumentNullException("source"); if (rng == null) throw new ArgumentNullException("rng"); return source.ShuffleIterator(rng); } private static IEnumerable ShuffleIterator( this IEnumerable source, Random rng) { List buffer = source.ToList(); for (int i = 0; i < buffer.Count; i++) { int j = rng.Next(i, buffer.Count); yield return buffer[j]; buffer[j] = buffer[i]; } } }