コード例 #1
0
 public void MoveGenerationsForward(long generations = 1)
 {
     for (long i = 0; i < generations; i++)
     {
         _currentPotRow = _currentPotRow.NextGeneration();
         if (i % 100 == 0)
         {
             Console.WriteLine($"At generation {i} number of plants {_currentPotRow.CurrentNumberOfPlants}");
             Console.WriteLine(_currentPotRow.CurrentState);
         }
     }
 }
コード例 #2
0
 public LifeCyclePotrow(string initial, IEnumerable <string> spreadCombinations)
 {
     _currentPotRow = new PotRow(0, initial, spreadCombinations);
     File.AppendAllLines("out.txt", new[] { _currentPotRow.CurrentState });
     Console.WriteLine(_currentPotRow.CurrentState);
 }