wip
Alpha Chen 9 years ago
parent 5b888267f8
commit 2902da8767

@ -5,6 +5,10 @@ class Grid < Struct.new(:state)
neighbors = self.neighbors(x,y).count(?#) neighbors = self.neighbors(x,y).count(?#)
(light == ?#) ? (([2,3].include?(neighbors)) ? ?# : ?.) : ((neighbors == 3) ? ?# : ?. ) (light == ?#) ? (([2,3].include?(neighbors)) ? ?# : ?.) : ((neighbors == 3) ? ?# : ?. )
}} }}
state_[0][0] = ?#
state_[0][99] = ?#
state_[99][0] = ?#
state_[99][99] = ?#
Grid.new(state_) Grid.new(state_)
end end

Loading…
Cancel
Save