Skip to content

Commit 02f12f5

Browse files
committed
06-2.rb: add progress bar
1 parent 92a8312 commit 02f12f5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

06-2.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
require 'numo/narray'
44
require 'parallel'
5+
require 'progressbar'
56

67
class Map
78
attr_reader :height, :width, :map, :init_guard_x, :init_guard_y, :init_guard_dir
@@ -146,7 +147,7 @@ def to_s
146147
map = Map.new File.read('06.input').lines.map(&:strip)
147148
map.walk!
148149

149-
puts(Parallel.map(map.route) do |candidate_obstacle|
150+
puts(Parallel.map(map.route, progress: 'Solving') do |candidate_obstacle|
150151
simulation = map.clone
151152
simulation.reset!
152153
simulation.add_obstacle(candidate_obstacle[0], candidate_obstacle[1])

0 commit comments

Comments
 (0)