Class: Life::CLI::Base

Inherits:
Thor
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/life/cli.rb

Instance Method Summary collapse

Instance Method Details

#newObject



17
18
19
20
21
22
# File 'lib/life/cli.rb', line 17

def new
  seed = build_seed(options[:seed])
  max_gen = options[:generations]
  world = World.new(options[:height], options[:width], seed)
  display_simulation max_gen, options[:height], world
end

#randomObject



29
30
31
32
33
34
# File 'lib/life/cli.rb', line 29

def random
  seed = build_random_seed options[:width], options[:height]
  max_gen = options[:generations]
  world = World.new(options[:height], options[:width], seed)
  display_simulation max_gen, options[:height], world
end