Module: GolCol

Defined in:
lib/Gol_Col.rb,
lib/Gol_Col/version.rb

Constant Summary collapse

VERSION =
"0.1.0"

Instance Method Summary collapse

Instance Method Details

#startObject



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/Gol_Col.rb', line 5

def start
  puts "[...The game stops after 100 iterations...]"
  print "Insert row length: "
  row = gets.chop.to_i
  print "Insert column length: "
  column = gets.chop.to_i
  board = Array.new(row){Array.new(column){ rand(0..1) } }
  play = GameOfLife.new(row, column)
  play.display_board(board)
  play.next_board(board)
end