// Collection of code snippets by Arne Vajhøj // (from articles on eksperten.dk / vajhoej.dk written sometime between 2004 and now) using System; public class Program { private static void Test(RNG rng) { for(int i = 0; i < 10; i++) { Console.WriteLine(rng.GetInt()); } for(int i = 0; i < 10; i++) { Console.WriteLine(rng.GetDouble()); } } private static void TestMinStd() { Test(new MinStd(1234567)); } private static void TestUniform32() { Test(new Uniform32(1234567, 1234567)); } private static void TestLEcuyer() { Test(new LEcuyer(new int[] { 1234567, 1234567, 1234567, 1234567, 1234567 })); } private static void TestCMRG() { Test(new CMRG(new int[] { 1234567, 1234567, 1234567 }, new int[] { 1234567, 1234567, 1234567 })); } public static void Main(string[] args) { TestMinStd(); TestUniform32(); TestLEcuyer(); TestCMRG(); } }