Skip to content

Commit

Permalink
make options for random optional and give them a default
Browse files Browse the repository at this point in the history
  • Loading branch information
Joel Quenneville committed Sep 20, 2012
1 parent 0624ff7 commit cc725d4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/life/cli.rb
Expand Up @@ -22,9 +22,9 @@ def new
end

desc :random, "Create new game with random starting pattern"
method_option :width, :type => :numeric, :aliases => '-w', :desc => "Width of board", :required => true
method_option :height, :type => :numeric,:aliases => '-h', :desc => "Height of board", :required => true
method_option :generations, :type => :numeric,:aliases => '-g', :desc => "How many generations to display", :required => true
method_option :width, :type => :numeric, :aliases => '-w', :desc => "Width of board", default: 30
method_option :height, :type => :numeric,:aliases => '-h', :desc => "Height of board", default: 30
method_option :generations, :type => :numeric,:aliases => '-g', :desc => "How many generations to display", default: 30

def random
seed = build_random_seed options[:width], options[:height]
Expand Down

0 comments on commit cc725d4

Please sign in to comment.