Skip to content

Instantly share code, notes, and snippets.

@fcheung
fcheung / tr_tree.rb
Created October 15, 2015 19:52 — forked from gagaception/tr_tree.rb
tr_tree
class Tree
attr_accessor :payload, :children
def initialize(payload, children = [])
@payload = payload
@children = children
end
def traverse(&block)
yield self
@children.each {|child| child.traverse(&block)}
class Image
attr_accessor :data
def initialize (data)
@data = data
end
def image_blur
changes = []
@data.each_with_index do |row, row_index|
@fcheung
fcheung / cl1.rb
Created September 17, 2015 19:53 — forked from gagaception/challenge#1.rb
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