Skip to content

Instantly share code, notes, and snippets.

@fcheung
Forked from gagaception/challenge#1.rb
Created September 17, 2015 19:53
Show Gist options
  • Save fcheung/00273280cd45fb9eee02 to your computer and use it in GitHub Desktop.
Save fcheung/00273280cd45fb9eee02 to your computer and use it in GitHub Desktop.
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