This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person | |
attr_reader :address | |
def display_address(template = Template.new) | |
address.display(template) | |
self | |
end | |
end | |
class Address |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The Game of Life | |
# | |
# Rules | |
# Any live cell with fewer than two live neighbors dies, as if caused by under-population. | |
# Any live cell with two or three live neighbors lives on to the next generation. | |
# Any live cell with more than three live neighbors dies, as if by overcrowding. | |
# Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction. | |
# Example usage | |
# Game.new(150,50).randomize.run 1000 |