Esempio n. 1
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();
			}
		}
Esempio n. 2
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();
            }
        }
Esempio n. 3
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();
     }
 }
Esempio n. 4
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();
            }
        }
Esempio n. 5
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);
                }
            }
        }