Created
September 14, 2016 21:13
-
-
Save pdbradley/cadaeba4e166b03126726f658cb3b6cf to your computer and use it in GitHub Desktop.
for chase
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 :image | |
def initialize(image) | |
@image = image | |
end | |
def print_row(row) | |
row.each {|x| print x } | |
puts | |
end | |
def output_image | |
@image.each {|row| print_row(row) } | |
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