Wolfram Language

Visualize the Game of Life

The Wolfram Compiler generates optimized code that can be run in real time to get live dynamical simulations. The following example generates a real-time simulation of the famous two-dimensional cellular automaton Game of Life.

The compiled function takes an input grid, applies rules for one step of the Game of Life and returns the output grid. TypeSpecifier indicates that the input is a depth-2 array of machine integers, i.e. an integer matrix.

Create an initial state.

Use Dynamic to play the game in real time.

Related Examples

de es fr ja ko pt-br zh