lib/game_of_life/earth.rb
# GameOfLife::Cell is a grid element where
# GameOfLife::Earth is a grid
# This class doesn't hold any logic related to
# cell mutation rules
:Cell is a grid element where
GameOfLife::Earth is a grid
This class doesn't hold any logic related to
cell mutation rules
: Cell is a grid element where GameOfLife :: Earth is a grid This class doesn ' t hold any logic related to cell mutation rules
def next!
      @generation += 1
      @cells.each_with_index do |col, x|
        col.each_with_index do |cell, y|
          cell.neighbours = alive_neighbours(x, y)
        end
      end
      @cells.each { |row| row.each(&:next!) }
      nil
    end
def next! @generation += 1 @cells . each_with_index do | col , x | col . each_with_index do | cell , y | cell . neighbours = alive_neighbours ( x , y ) end end @cells . each { | row | row . each ( & :next! ) } nil end
GameOfLife::Cell is a grid element where
GameOfLife::Earth is a grid
This class doesn't hold any logic related to
cell mutation rules
GameOfLife :: Cell is a grid element where GameOfLife :: Earth is a grid This class doesn ' t hold any logic related to cell mutation rules