Exemplo n.º 1
0
        static void Main(string[] args)
        {
            int  width = 50, height = 30, borderwidth = 1;
            char livingCell = 'o', deadCell = ' ';
            int  value;

            Console.SetCursorPosition(0, 0);
            Console.ForegroundColor = ConsoleColor.Red;
            Console.WriteLine("Выберите режим игры:");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("1.Автоматический режим");
            Console.WriteLine("2.Ручной режим (переход к следующему шагу по нажатию Enter)");
            value = Convert.ToInt32(Console.ReadLine());
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Green;
            Console.WriteLine("                         Инструкция");
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine("Для того чтобы поставить/удалить клетку - нажмите кнопку Space");
            Console.WriteLine("Игра будет начата через 10 секунд...");
            Thread.Sleep(10000);
            Console.Clear();
            Console.ForegroundColor = ConsoleColor.Green;
            GameOfLife.CreateInstance(width, height, borderwidth, livingCell, deadCell, value);
            GameOfLife.GetDrawing();
            GameOfLife.Start();
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            Console.OutputEncoding  = Encoding.UTF8;
            Console.BackgroundColor = ConsoleColor.Black;
            Console.ForegroundColor = ConsoleColor.DarkRed;

            int  width = 40, height = 20, spawnProbability = 7;
            char aliveCell = '0', deadCell = ' ';

            Console.Read();
            GameOfLife game = new GameOfLife(width, height, 1, aliveCell, deadCell);

            game.RandomFill(spawnProbability);
            game.Start();
        }
Exemplo n.º 3
0
        static void Main(string[] args)
        {
            GameOfLife game = new GameOfLife(50);

            game.Start();
        }