diff --git a/Hypertension.rb b/Hypertension.rb index a89fc75..252f99d 100644 --- a/Hypertension.rb +++ b/Hypertension.rb @@ -83,7 +83,7 @@ def planning(tasks, level = 0) puts "#{' ' * level.pred}#{method}(#{current_task.join(' ')})" if @debug # Every unification is tested __send__(method, *current_task) {|subtasks| - subtasks.each {|t| [(@index += 1 if @domain[t[0]]), t]} + subtasks.map! {|t| [(@index += 1 if @domain[t[0]]), t]} new_index = @index if plan = planning(subtasks.concat(tasks), level) @decomposition.unshift("#{index} #{task_name} #{current_task.join(' ')} -> #{method[task_name.size+1..-1]} #{(old_index+1..new_index).to_a.join(' ')}")