Пример #1
0
        static void Main(string[] args)
        {
            // get valid board size
            int rows = GetIntInput("Enter number of rows greater than 0");
            int columns = GetIntInput("Enter number of columns greater than 0");

            // get valid number of generations
            int generations = GetIntInput("Enter number of generations greater than 0");

            Grid grid = new Grid(rows, columns);
            grid.PopulateGrid();

            for (int i = 0; i < generations; i++)
            {
                PrintCells(grid, i);

                grid = grid.NextGeneration();

                Thread.Sleep(200);
            }

            Console.ReadKey();
        }