planter.rb: Utilize display code now in Gardner
This commit is contained in:
parent
280d016d38
commit
802074a513
1 changed files with 3 additions and 16 deletions
|
@ -21,7 +21,7 @@ module Planter
|
||||||
def plant
|
def plant
|
||||||
@plot = Plot.new
|
@plot = Plot.new
|
||||||
@plot.tree = @file
|
@plot.tree = @file
|
||||||
@plot.trunk = @file.shift.values[0]
|
@plot.trunk = @file.shift
|
||||||
@plot.branches = Gardner.prune_branches(@file)
|
@plot.branches = Gardner.prune_branches(@file)
|
||||||
|
|
||||||
dig(1)
|
dig(1)
|
||||||
|
@ -35,22 +35,9 @@ module Planter
|
||||||
def dig(branch_no)
|
def dig(branch_no)
|
||||||
branch = @plot.branches[branch_no]
|
branch = @plot.branches[branch_no]
|
||||||
|
|
||||||
# Print the trunk
|
Gardner.display_trunk(@plot.trunk)
|
||||||
40.times { print "-" }
|
Gardner.display_branch(branch, branch_no, true)
|
||||||
puts "\n[ Trunk ]\n#{@plot.trunk}"
|
|
||||||
40.times { print "-" }
|
|
||||||
puts "\n"
|
|
||||||
10.times { print "*" }
|
|
||||||
|
|
||||||
# Print the branch and options
|
|
||||||
puts "\n[ Branch: #{branch_no} ]"
|
|
||||||
puts "\n#{branch["desc"]}\n\n"
|
|
||||||
unless branch["options"].empty?
|
|
||||||
branch["options"].each_pair do |k,v|
|
|
||||||
puts "\t#{k}: #{v.keys[0]}"
|
|
||||||
puts "\t\t [ Goes to branch #{v.values[0]} ]"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Edit the trunk of the tree
|
# Edit the trunk of the tree
|
||||||
|
|
Loading…
Reference in a new issue