Last active
October 13, 2015 14:03
-
-
Save gagaception/9eafaa28d0e0514cf634 to your computer and use it in GitHub Desktop.
image_blur
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Image | |
attr_accessor :data | |
def initialize (data) | |
@data = data | |
end | |
def output | |
@data.each do |sub| | |
sub.each do |cell| | |
print cell | |
end | |
puts "\n" | |
end | |
end | |
end | |
image = Image.new([[0,0,0,0,1], | |
[0,1,0,0,0], | |
[0,0,0,1,0], | |
[0,0,0,0,1]]) | |
image.output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
after changing initialize method everything works as it should