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
		static void Main(string[] args)
		{
			var game = new ConwaysLife(20, 20, new ConsoleUi(20, 20));
			game.SetAge(new Point(5, 0), 1);
			game.SetAge(new Point(6, 1), 1);
			game.SetAge(new Point(7, 1), 1);
			game.SetAge(new Point(6, 2), 1);
			game.SetAge(new Point(5, 2), 1);
			while (true)
			{
				game.Step();
				Console.ReadKey();
			}
		}
示例#7
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();
            }
        }
示例#8
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);
                }
            }
        }