functional game of life