Skip to content

Instantly share code, notes, and snippets.

@fcheung
Forked from gagaception/challenge#1.rb
Created Sep 17, 2015
Embed
What would you like to do?
cl1.rb
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],
[0,1,0,0],
[0,0,0,1],
[0,0,0,0]])
image.output
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment