public static void addRabbit(int population, int populationLimit)
        {
            if (population >= populationLimit)
            {
                return;
            }

            Rabbit rabbit = new Rabbit();

            rabbit.Name = $"Rabbit{population + 1}";
            rabbit.Age  = 0;
            rabbits.Add(rabbit);
            File.AppendAllText("myLogFile.log", $"{rabbit.Name} created at time {DateTime.Now}\n");
        }
        public static int Rabbit_Exponential_Growth(int populationLimit)
        {
            List <Rabbit> rabbits = new List <Rabbit>();

            var adultAge      = 3;
            var yearCounter   = 0;
            var rabbitCounter = 0;
            var initialRabbit = new Rabbit();

            initialRabbit.Name = "Rabbit0";
            rabbits.Add(initialRabbit);
            while (true)
            {
                for (int i = 0; i < rabbits.Count; i++)
                {
                    Console.WriteLine($"{rabbits[i].Name} has age {rabbits[i].Age}");
                    if (rabbits[i].Age >= adultAge)
                    {
                        var rabbit = new Rabbit();
                        rabbit.Name = $"Rabbit{rabbitCounter}";
                        rabbits.Add(rabbit);

                        rabbitCounter++;
                    }
                    rabbits[i].Age++;
                }



                if (rabbits.Count > populationLimit)
                {
                    break;
                }
                // increment counters
                yearCounter++;
            }

            Console.WriteLine($"Population limit exceeded at year {yearCounter} " +
                              $"with population of  {rabbits.Count}");

            return(yearCounter);
        }