Utilizing JSXGraph to Implement John Conway's Game of Life
Leslie Wong
Shenzhen University, Guangdong, China
Motivation
Game of Life is a renowned cellular automation model devised by John Conway, a mathematician at Cambridge. However, when searching “game of life John Conway” at Google Images, it is hard to spot an elegant and appealing implementation. Therefore, as I came across the wonderful JavaScript animation library JSXGraph by chance and was obsessed with its UI, the aspiration to implement game of life by my own was aroused. As a result, I commenced to develop this JSXGraph-version game of life project. https://playgameoflife.live
Proposition Definition
The universe of the Game of Life is an infinite, two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive of dead, (or populated and unpopulated, respectively). Every cell interacts with its eight neighbors, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:
- For a box with a live cell:
- There existing fewer than two live neighbors, the cell dies, due to loneliness.
- There existing more than three live neighbors, the cell dies, due to crowding.
- There existing two or three live neighbors, the cell lives on to the next generation.
- For an empty box or a box with a dead cell: *There existing three neighbors, the box generates a new live cell, as if by reproduction.
Project Architecture
The project architecture of my game of life implementation is illustrated as follows.
Project architecture
Implementation Result
The snapshot of the implementation result can be seen as follows.
Implementation result
Further Details
For further details, please refer to https://github.com/Leslie-Wong-H/game_of_life.