From the wikipedia page:
"The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves. It is Turing complete and can simulate a universal constructor or any other Turing machine."
Se the rules page for more information.
we are using rbenv
for ruby versioning
brew install rbenv
make sure to install the correct .ruby-version
rbenv install <ruby_version>
we are using bundler for gems
gem install bundler
we are using rspec for testing.
rspec
This repo has been published as a Ruby Gem.
This repo features the algorithm for Game of Life. The main way to use this is to call:
GameOfLife.tick(universe)
The .tick(universe)
expects universe
to be multiple arrays of 1
's and 0
's. For our purposes, 1
indicates the cell is ALIVE
and 0
indicates the cell is DEAD
.
The method .tick(universe)
will give you the next iteration. You can call tick
as many times as you like.
Note: See the test suite for example universes used for .tick(universe)
.