diff --git a/Hypertension.rb b/Hypertension.rb index a32ec8a..9c932cf 100644 --- a/Hypertension.rb +++ b/Hypertension.rb @@ -254,9 +254,7 @@ def problem(state, tasks, debug = false, ordered = true) t = Time.now.to_f plan = ordered ? planning(tasks) : task_permutations(state, tasks, (tasks.pop if tasks.dig(-1,1,0) == :invisible_goal)) puts "Time: #{Time.now.to_f - t}s", 'Plan'.center(50,'-') - if plan - puts 'Empty plan' if plan.empty? - puts '==>', plan.map {|d| d.join(' ')}, root, @decomposition, '<==' + if plan then puts '==>', plan.map {|d| d.join(' ')}, root, @decomposition, '<==' else abort(@nostack ? 'Planning failed, try with more stack' : 'Planning failed') end plan