Beispiel #1
0
        public void IterateAutomataIterations3()
        {
            string[] inGrid =
            {
                "XXXXX",
                "X...X",
                "X...X",
                "X...X",
                "XXXXX",
            };

            string[] outGrid =
            {
                "XXXXX",
                "XXXXX",
                "XXXXX",
                "XXXXX",
                "XXXXX",
            };

            bool[][] map     = GridTest.InitBoolGrid(inGrid);
            bool[][] compare = GridTest.InitBoolGrid(outGrid);

            bool[][] result = NoiseGen.IterateAutomata(map, CellRule.None, CellRule.Gte4, 3);
            Assert.That(result, Is.EqualTo(compare));
        }
Beispiel #2
0
        public void IterateAutomataSingle7(CellRule rule, bool expected)
        {
            // test to verify all neighbors are influencing decision correctly
            string[] inGrid =
            {
                "X..",
                "...",
                "...",
            };

            bool[][] map = GridTest.InitBoolGrid(inGrid);

            bool[][] result = NoiseGen.IterateAutomata(map, CellRule.None, rule, 1);
            Assert.That(result[1][1], Is.EqualTo(expected));
        }