// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Collections; class MainClass { public static void Main(string[] args) { Random rng = new Random(); ArrayList list = new ArrayList(); for(int i = 1; i < 45; i++) list.Add(i); for(int j = 0; j < 7; j++) { int ix = rng.Next(list.Count); int n = (int)list[ix]; list.RemoveAt(ix); Console.WriteLine(n); } } }