Make Grid#crop easier to read

openid
Marcin Kulik 11 years ago
parent 731fb11e8b
commit c3fc452b91

@ -17,7 +17,8 @@ class Grid
end
def crop(x, y, width, height)
self.class.new(lines[y...y+height].map { |line| line[x...x+width] })
cropped_lines = lines[y...y+height].map { |line| line[x...x+width] }
self.class.new(cropped_lines)
end
def diff(other)

Loading…
Cancel
Save