[2018][ruby][10.2]
change nzmosvzwkrqunqpyuttkmtlmqlplkqxv
commit acfe5be203c456c28de0d9261bc44ffa119f1ada
author Alpha Chen <alpha.chen@gmail.com>
date
parent nsqxrvys
diff --git a/2018/ruby/day_10.rb b/2018/ruby/day_10.rb
index b3cb247..42a2c71 100644
--- a/2018/ruby/day_10.rb
+++ b/2018/ruby/day_10.rb
@@ -351,7 +351,7 @@ def print_points(points)
   max_y = points.map(&:position).map(&:last).max
 
   # return if max_x - min_x > 500
-  return if max_y - min_y > 100
+  return if max_y - min_y > 10
 
   h = points.each.with_object(Hash.new(?.)) {|point, h|
     h[point.position] = ?#
@@ -367,10 +367,13 @@ def print_points(points)
   gets
 end
 
+i = 0
 loop do
   print_points(points)
+  puts i
   points.each {|point|
     point.position[0] += point.velocity[0]
     point.position[1] += point.velocity[1]
   }
+  i += 1
 end