using System; using System.Collections; class App{ public static void Main(){ Die d1 = new Die(6), d2 = new Die(10), d3 = new Die(16), d4 = new Die(8); int sum = 0; string netString = ""; // Working with sets of dice: Set s1 = new Set( // A set of dice new Die[]{d1, d2, d3, d4}); foreach(Die d in s1){ d.Toss(); Console.WriteLine("{0}", d); } // Working with sets of ints Set s2 = new Set( // A set of ints new int[]{1, 2, 3, 4}); foreach(int i in s2) sum += i; Console.WriteLine("Sum: {0}", sum); // Working with sets of strings Set s3 = new Set( // A set of strings new string[]{"a", "b", "c", "d"}); foreach(string str in s3) netString += str; Console.WriteLine("Appended string: {0}", netString); } }