示例#1
0
        private static void TestGenerate(LifeJourney life)
        {
            life.GenerateRandomField(12345, 0.5);
            Assert.AreEqual(1034216, life.GetLiveCellsCount());
            Assert.AreEqual(1583560213, life.GetFingerprint());

            life.Clear();
            life.GenerateRandomField(12345, 0.1);
            Assert.AreEqual(206625, life.GetLiveCellsCount());
            Assert.AreEqual(-1430538206, life.GetFingerprint());
        }
示例#2
0
        private static void TestRandomField(LifeJourney life)
        {
            life.GenerateRandomField(12345, 0.5);
            life.Step();
            Assert.AreEqual(565797, life.GetLiveCellsCount());
            Assert.AreEqual(-717568334, life.GetFingerprint());

            life.Clear();
            life.GenerateRandomField(12345, 0.1);
            life.Step();
            Assert.AreEqual(98717, life.GetLiveCellsCount());
            Assert.AreEqual(1237589375, life.GetFingerprint());
        }