game of life in scala