Scala functional solution for Conway's Game of Life