Esempio n. 1
0
        static void Main(string[] args)
        {
            int noOfTicks; string readLine;

            do
            {
                Console.WriteLine("Please enter the number of ticks:");
                readLine = Console.ReadLine();
                if (!IsValidNumber(readLine, out noOfTicks))
                {
                    Console.WriteLine("'{0}' is not a valid number.", readLine);
                }
            } while (!IsValidNumber(readLine, out noOfTicks));

            var game = new Game(60);
            foreach (Point point in GetSeed())
            {
                game.BringCellToLifeAt(point.X, point.Y);
            }

            for (int i = 0; i < noOfTicks; i++)
            {
                Console.Clear();
                game.Tick();
                Console.WriteLine(game.ToString());
                Thread.Sleep(300);
            }

            Console.ReadKey();
        }