public void singleCell_dissapear_afterStep()
        {
            var game = new ConwaysLife(10, 10, new FakeUi());
            game.ReviveCells(new Point(1, 1));

            game.Step();

            Assert.AreEqual(0, game.GetAge(new Point(1, 1)));
        }
        public void singleCell_dissapear_afterStep()
        {
            var game = new ConwaysLife(10, 10, new FakeUi());

            game.ReviveCells(new Point(1, 1));

            game.Step();

            Assert.AreEqual(0, game.GetAge(new Point(1, 1)));
        }
Пример #3
0
		private static void Main(string[] args)
		{
			var ui = new ConsoleUi(20, 20);
			var game = new ConwaysLife(20, 20, ui);
			game.ReviveCells(glider);
			while (true)
			{
				Console.ReadKey(intercept:true);
				game.Step();
			}
		}
Пример #4
0
        private static void Main(string[] args)
        {
            var ui   = new ConsoleUi(20, 20);
            var game = new ConwaysLife(20, 20, ui);

            game.ReviveCells(glider);
            while (true)
            {
                Console.ReadKey(intercept: true);
                game.Step();
            }
        }
Пример #5
0
 private static void Main(string[] args)
 {
     var ui = new ConsoleUi(20, 20);
     var game = new ConwaysLife(20, 20, ui);
     game.ReviveCells(
         new Point(5, 0), new Point(5, 2),
         new Point(6, 1), new Point(6, 2),
         new Point(7, 1));
     while (true)
     {
         Console.ReadKey(intercept:true);
         game.Step();
     }
 }
Пример #6
0
        private static void Main(string[] args)
        {
            var ui   = new ConsoleUi(20, 20);
            var game = new ConwaysLife(20, 20, ui);

            game.ReviveCells(
                new Point(5, 0), new Point(5, 2),
                new Point(6, 1), new Point(6, 2),
                new Point(7, 1));
            while (true)
            {
                Console.ReadKey(intercept: true);
                game.Step();
            }
        }
Пример #7
0
        private static void Main(string[] args)
        {
            var ui = new ConsoleUi(20, 20);
            var game = new ConwaysLife(20, 20);

            game = game.ReviveCells(glider);
            ui.Update(game);

            while (true)
            {
                Console.ReadKey(intercept: true);

                var tuple = game.Step();
                game = tuple.Item1;
                foreach (var i in tuple.Item2)
                {
                    ui.Update(i.Key.X, i.Key.Y, i.Value);
                }
            }
        }