Lecture 9
Lecture 9
Engineering Programming
Prof. Keonwook Kim
Division of Electronics and Electrical Engineering
Dongguk University, Seoul, Korea
Game of life
• Rule
• A live cell with two live neighbors, or any cell with three live
neighbors, is alive at the next step.
Game of life
• The beginning of the evolution of the most important five-
cell initial population, known as the glider
Experiments with MATALB – Cleve Moler
Game of life
• See the game in action
• https://www.youtube.com/watch?v=ouipbDkwHWA
• MATLAB is a convenient environment for implementing the
Game of Life.
• The population is the set of nonzero elements in the matrix.
• Store the population in a finite matrix, most of whose elements are
zero, and increase the size of the matrix if necessary when the
population expands.
Game of life
• Sparse matrix
• Conventional storage of an n-by-n matrix requires n memory. 2
Game of life
• The initial population is represented by a matrix of 0’s and 1’s.
Game of life
• Produces a sparse matrix with integer elements between 0
and 8 that counts how many of the eight neighbors of each
interior cell are alive.
Experiments with MATALB – Cleve Moler
Game of life
• A live cell with two live neighbors, or any cell with three live
neighbors, is alive at the next step.
Game of life
• Create your own fleet of gliders fleet.