<commit_before>class Grid

  def initialize(cell)
    @cells = Array.new(35) do 
      Array.new(100) do 
        cell.new([true,false].sample)
      end
    end
  end

  def tick
    @cells.each_with_index do |row,i|
      row.each_with_index do |cell,j|
        neighbors = @cells[(i-1)..(i+1)].flat_map { |r| r[((j-1)..(j+1))] }
        neighbors.delete(cell)
        cell.process_alive_count(neighbors)
      end
    end

    @cells.each do |row|
      row.each do |cell|
        cell.tick
      end
    end
  end

  def display
    @cells.each do |row|<commit_msg>Condense logic into single line.<commit_after>class Grid

  def initialize(cell)
    @cells = Array.new(35) do 
      Array.new(100) do 
        cell.new([true,false].sample)
      end
    end
  end

  def tick
    @cells.each_with_index do |row,i|
      row.each_with_index do |cell,j|
        neighbors = @cells[(i-1)..(i+1)].flat_map { |r| r[((j-1)..(j+1))] }
        neighbors.delete(cell)
        cell.process_alive_count(neighbors)
      end
    end

    @cells.each { |r| r.each { |c| c.tick } }
  end

  def display
    @cells.each do |row|
{'fraction_non_alphanumeric': 0.1405550581915846, 'fraction_numerical': 0.01611459265890779, 'mean_word_length': 2.15819209039548, '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': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5671885', 'n_tokens_mistral': 448, 'n_tokens_neox': 418, 'n_words': 87}