Skip to content

Instantly share code, notes, and snippets.

@pdbradley
Created September 14, 2016 21:13
Show Gist options
  • Save pdbradley/cadaeba4e166b03126726f658cb3b6cf to your computer and use it in GitHub Desktop.
Save pdbradley/cadaeba4e166b03126726f658cb3b6cf to your computer and use it in GitHub Desktop.
for chase
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