Class: Rsb::Gol::Cli

Inherits:
Thor
  • Object
show all
Defined in:
lib/rsb/gol/cli.rb

Instance Method Summary collapse

Instance Method Details

#startObject



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/rsb/gol/cli.rb', line 14

def start
  columns, rows = HighLine::SystemExtensions.terminal_size
  rows      -= 10
  columns   -= 10
  iterations = options.iterations
  alive      = options.alive_char
  dead       = options.death_char

  columns = options.columns if options.columns?
  rows    = options.rows    if options.rows?

  # ✺ ☻ ⬣ ● ⨀
  game = Rsb::Gol::Game.new(cols: columns, rows: rows)
  game.start(iterations, alive, dead)
end