Implementation of game of life