Skip to content

Instantly share code, notes, and snippets.

@chadoh
Forked from umasenthil/Img blur 1
Last active November 13, 2015 02:30
Show Gist options
  • Save chadoh/5c2e3c83ef6aff4131e9 to your computer and use it in GitHub Desktop.
Save chadoh/5c2e3c83ef6aff4131e9 to your computer and use it in GitHub Desktop.
class Image
def initialize(arr)
@arr = arr
end
def print
@arr.each do |sub_array|
puts sub_array.join('')
end
end
end
image = Image.new([
[0, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 0, 1],
[0, 0, 0, 0]
])
image.print
@chadoh
Copy link
Author

chadoh commented Nov 13, 2015

@umasenthil here's the more idiomatic-Ruby way to do this that we discussed in our mentor session 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment