<commit_before>function GameOfLife(zeroGeneration, canvas) {
  var GoL         = GameOfLife
    , canvas      = GoL.Support.parseCanvas(canvas)
    , generation  = GoL.Support.parseCellGrid(zeroGeneration);

  return {
    evolve: function () {
      var graphics        = GoL.Graphics(canvas, generation)
        , numGenerations  = 0;

      function doEvolve() {
        graphics.drawFrame(generation, numGenerations);
        generation = GoL.Generation.tick(generation);
        numGenerations += 1;
      }

      doEvolve();
      setInterval(function () {
        doEvolve();
      }, 2000);
    }
  };
}<commit_msg>Evolve until evolution halts (no change)<commit_after>function GameOfLife(zeroGeneration, canvas) {
  var GoL               = GameOfLife
    , currentGeneration = GoL.Support.parseCellGrid(zeroGeneration)
    , graphics          = GoL.Graphics(GoL.Support.parseCanvas(canvas), currentGeneration);

  function generationHasEvolved(previousGeneration, currentGeneration) {
    return !_.isEqual(previousGeneration, currentGeneration);
  }

  return {
    evolve: function () {
      var numGenerations = 0
        , previousGeneration;

      function evolveUntilHalt() {
        graphics.drawFrame(currentGeneration, numGenerations);
        previousGeneration = currentGeneration;
        currentGeneration = GoL.Generation.tick(previousGeneration);

        if (generationHasEvolved(previousGeneration, currentGeneration)) {
          numGenerations += 1;
          setTimeout(evolveUntilHalt, 1000);
        }
      }

      evolveUntilHalt();
    }
  };
}
{'fraction_non_alphanumeric': 0.09734513274336283, 'fraction_numerical': 0.007585335018963337, 'mean_word_length': 2.8609756097560974, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1734266', 'n_tokens_mistral': 451, 'n_tokens_neox': 419, 'n_words': 76}