public Simulation() { ran = new Rand(); spin = new int[LENGTH]; nbr1 = new int[LENGTH]; nbr2 = new int[LENGTH]; }
static void CheckRandom() { Double sum = 0.0; Int32 n = 10000000; Rand ran = new Rand(); for (int i = 0; i < n; i++) sum += ran.Next(); Double avg = sum / n; Debug.Assert(Math.Abs(avg - 0.5) <= 0.01, "The random number generator does not work."); }