Пример #1
0
        public void tick_world_brings_dead_cells_to_life_when_has_3_neighbours()
        {
            var world = new World();

            world.SetupWorld(
                "0+0", // <- we expect the cell at 2,0 to come alive because it has 3 neighbours
                "0++",
                "000");

            World worldAfterTick = world.Tick();

            Assert.True(worldAfterTick.IsCellAlive(new Position(2, 0)));
        }
Пример #2
0
        static void Main(string[] args)
        {
            var world = new World();

            string[] setup = ConwayBoards.Puffer();

            world.SetupWorld(setup);

            var model = new WorldToConwayModelWrapper(world);

            // you can use the constant speed model if you want things to happen at a specific pace - useful
            // if the technology being used to render does not take long - for us, console is the bottle neck.

            //var clock = new SystemClock();
            //var constantModel = new ConwayConstantSpeedModel(model, clock) {TicksPerSecond = 3};

            var display = new ConwayTerminalDisplay(79, 35, model);

            display.Start();
        }