Skip to content

Instantly share code, notes, and snippets.

@isomorpheric
Created February 10, 2016 19:57
Show Gist options
  • Save isomorpheric/94ff09c57698ad9d0e08 to your computer and use it in GitHub Desktop.
Save isomorpheric/94ff09c57698ad9d0e08 to your computer and use it in GitHub Desktop.
# Image Blur 2
# I have no idea what to do. I'm pretty sure it has to do with making a row method, or a pixel method.
# yet I'm up in the air about what to do with them. Last time we spoke, you had mentioned making
# another class. If you could point me in the right direction so I can have something more solid tomorrow
# it would be awesome. Otherwise, see you then.
# The purpose of this problem is to convert any numbers on the top, bottom, left and right of every "1".
class Image
def initialize(array)
@array = array
end
def output_image
@array.each do |row|
puts row.join(" ")
end
nil
end
end
image = Image.new([
[0, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 0, 1],
[0, 0, 0, 0]
])
image.output_image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment