summaryrefslogtreecommitdiffstats
path: root/CLI/ruby/bin
diff options
context:
space:
mode:
Diffstat (limited to 'CLI/ruby/bin')
-rwxr-xr-xCLI/ruby/bin/game-of-life8
1 files changed, 8 insertions, 0 deletions
diff --git a/CLI/ruby/bin/game-of-life b/CLI/ruby/bin/game-of-life
index 14f5647..4de4fd4 100755
--- a/CLI/ruby/bin/game-of-life
+++ b/CLI/ruby/bin/game-of-life
@@ -25,6 +25,12 @@ class CLI < Thor
class_option "height", aliases: "-h", type: :numeric, banner: :HEIGHT,
desc: "Specify the hight of generated universe. (default to terminal height)"
+
+ class_option "dead-cell", type: :string, banner: :CHAR, default: "\s",
+ desc: "Specify the dead-cell representation"
+
+ class_option "live-cell", type: :string, banner: :CHAR, default: "\u2588",
+ desc: "Specify the dead-cell representation"
def start
options_with_defaults = {
"height" => IO.console.winsize[0],
@@ -32,6 +38,8 @@ class CLI < Thor
"seed" => rand(100_000),
}.merge(options)
+ GameOfLife::Cell.const_set(:LIVE_CELL, options["live-cell"])
+ GameOfLife::Cell.const_set(:DEAD_CELL, options["dead-cell"])
universe = GameOfLife::Generators::Input.new(options_with_defaults)
puts universe
end