产品功能

应用市场介绍

Conway's Game of Life, also known as Conway's Life Chess, is a cellular automaton invented by British mathematician John Horton Conway in 1970.

It first appeared in the "Mathematical Games" column by Martin Gardner in the October 1970 issue of Scientific American magazine.

In the Game of Life, each cell has two states - alive or dead. Each cell interacts with the eight cells surrounding it centered on itself. For any cell, the rules are as follows:

1. When the current cell is in the alive state and the number of surrounding alive cells is less than 2 (not including 2), the cell turns into the dead state. (Simulating a scarce population.)

2. When the current cell is in the alive state and there are 2 or 3 surrounding alive cells, the cell remains the same.

3. When the current cell is in the alive state and there are more than 3 surrounding alive cells, the cell turns into the dead state. (Simulating overpopulation.)

4. When the current cell is in the dead state and there are 3 surrounding alive cells, the cell turns into the alive state. (Simulating reproduction.)

The initial cell structure can be defined as the seed. When all the cells in the seed are processed by the above rules simultaneously, the first generation of the cell diagram can be obtained. Continuing to process the current cell diagram according to the rules, the next generation of the cell diagram can be obtained, and so on.

The Game of Life is a zero-player game. It consists of a two-dimensional rectangular world where each square houses a living or dead cell. Whether a cell lives or dies at the next moment depends on the number of living or dead cells in the eight adjacent squares. If the number of living cells in the adjacent squares is too large, the cell will die at the next moment due to lack of resources; on the contrary, if there are too few living cells around, the cell will die of loneliness. In practice, players can set how many living cells in the surrounding area are suitable for the survival of the cell. If this number is set too high, most of the cells in the world will die because they can't find enough living neighbors until there is no life left in the whole world; if this number is set too low, the world will be filled with life and there will be little change.

In practice, this number is generally chosen as 2 or 3; in this way, the whole living world won't be too desolate or crowded, but a dynamic balance. Then, the rules of the game are: when there are 2 or 3 living cells around a square, the living cells in the square will continue to survive at the next moment; even if there are no living cells in the square at this moment, living cells will "be born" at the next moment.

In this game, some more complex rules can also be set. For example, the current state of the square not only depends on the previous generation but also considers the situation of the generation before the previous one. Players can also act as the "god" of this world and arbitrarily set the life or death of a cell in a square to observe the impact on the world.

During the progress of the game, chaotic cells will gradually evolve into various delicate and tangible structures; these structures often have good symmetry and change their shapes in each generation. Some shapes are locked and won't change from generation to generation. Sometimes, some formed structures will be destroyed by the "invasion" of some disordered cells. But shapes and order often emerge from chaos.

This game has been implemented by many computer programs. Many hackers in the Unix world like to play this game. They use characters to represent a cell and evolve it on a computer screen. A well-known example is that there is such a small game in the GNU Emacs editor.

收起

用户评价

立即分享产品体验

你的真实体验,为其他用户提供宝贵参考

宝石
评论可得 100 宝石
宝石随心兑换应用高级会员,每周更新 前往查看 >>
活动动态 0 人参加
查看更多评论