Created
November 30, 2016 23:36
-
-
Save pdbradley/bbfada7b6522da3cf7dd7e150ba9938a to your computer and use it in GitHub Desktop.
for conner image blur 1
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 | |
def initialize(image) | |
@image = image | |
end | |
def output_image | |
@image.each do |row| | |
row.each do |cell| | |
print cell # always puts a newline | |
end | |
puts "" | |
end | |
end | |
end | |
image = Image.new([ | |
[0, 0, 0, 0], | |
[0, 1, 0, 0], | |
[0, 0, 0, 1], | |
[0, 0, 0, 0] | |
]) | |
image.output_image | |
# image = Array[[0, 0, 0, 0],[0, 1, 0, 0],[0, 0, 0, 1],[0, 0, 0, 0]] | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment