life_opengl


life_opengl, a C++ code which sets up The Game of Life and allows a user to watch as it evolves, displaying the game using OpenGL().

The game begins with the user specifying the number of rows and columns, as well as the wrap around option (1 = wrap around, 0 = no.) These values can be command line arguments.

A grid of gray squares is presented, and the user can set any of the squares to be "alive" by clicking there. Once the squares have been initialized, the user can step through the phases of "life", by pressing return. At any time, the user may change the status of a square by clicking on it.

If the board is 'wrap around', then some information is passed between the first and last columns, and first and last rows.

Licensing:

The information on this web page is distributed under the MIT license.

Languages:

life_opengl is available in a C version and a C++ version a Fortran90 version and a MATLAB version and an Octave version.

Related Data and Programs:

opengl_test, a C++ code which uses opengl() to display graphic images on the screen;

Reference:

  1. Edward Angel,
    Interactive Computer Graphics, a Top-Down Approach with OpenGL,
    Addison-Wesley, 2000,
    ISBN: 0-201-38597-X,
    LC: T385.A514.
  2. Martin Gardner,
    Mathematical Games: The Fantastic Combinations of John Conway's new solitaire game "Life",
    Scientific American,
    Volume 223, Number 4, October 1970, pages 120-123.

Source Code:


Last revised on 25 March 2020.