Ruby code, game of life