Пример #1
0
        public static void Main(string[] args)
        {
            Console.SetWindowSize(120, 80);

            var universe = SeedUniverse(
                Blinker().AtPosition(20, 10),
                Blinker().AtPosition(93, 10),
                GliderSE().AtPosition(35, 10),
                WeirdGrowingThingy().AtPosition(50, 50),
                Pulsar().AtPosition(50, 20));

            var game = new Game();

            //var count = 0;
            //var start = DateTime.Now;
            while (true)
            {
                RenderUniverse(universe);
                universe = game.Tick(universe);
                Thread.Sleep(100);
                //count++;
            }
            //var end = DateTime.Now;
            //Console.WriteLine(end.Subtract(start).TotalMilliseconds);
        }
Пример #2
0
 private static IUniverse EvolveUniverse(IUniverse initialUniverse)
 {
     var game = new Game();
     return game.Tick(initialUniverse);
 }
 public static IUniverse Evolve(IEnumerable<ICellLocation> threeInARow)
 {
     var game = new Game();
     var initialUniverse = new Universe(threeInARow.ToArray());
     return game.Tick(initialUniverse);
 }