javascript implementation of conways game of life