The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in 1970. See Wikipedia entry. The idea is that cells grow or die according to a simple set of rules:
Any live cell with fewer than two live neighbors dies, as if by under-population.
Any live cell with two or three live neighbors lives on to the next generation.
Any live cell with more than three live neighbors dies, as if by overcrowding.
Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.
This implementation illustrates how the higher order method 'foldLeft' can be used in place of a 'for' loop (not to be confused with for expressions) to iterate over the cell population. This is a fundamental concept in functional programming. Take it easy if it doesn't make sense right now. It will eventually. I took a full blown course to get to learn all that from a wonderful teacher: Eric Meijer's intro to teaching functional programming with Haskell. You can study the whole course in YouTube, or from the archives of edx.org.
Click here and start the fun! http://ikojo.in/sf/pUmyQ66/9
Or start with a simpler pattern and see a steady-state: http://ikojo.in/sf/pUmyQ66/10
Or, see a seemingly more complicated starting point: http://ikojo.in/sf/pUmyQ66/13
But, run it to see how short-lived it is: http://ikojo.in/sf/pUmyQ66/12
Check this one out, called block1: http://ikojo.in/sf/pUmyQ66/14
Now run it and enjoy: http://ikojo.in/sf/pUmyQ66/15
It will eventually converge to a steady-state, but it takes a while. So, run it faster: http://ikojo.in/sf/pUmyQ66/16
Now, go back or forward and read some more musings about it here (search for Game of Life in the page, it's towards the bottom...