[阅读: 411] 2011-01-27 06:51:36
The Game of Life, invented by John Conway in 1970, is an example of a zero-player “game” known
as a cellular automaton. The game consists of a two-dimensional world extending infinitely in all
directions, divided into “cells.” Each cell is either “dead” or “alive” at a given “generation.” The
game consists of a set of rules that describe how the cells evolve from generation to generation.
These rules calculate the state of a cell in the next generation as a function of the states of its
neighboring cells in the current generation. In a 2-D world, a cell’s neighbors are those 8 cells
vertically, horizontally, or diagonally adjacent to that cell. Conway’s set of rules are summarized
as:
在一个无限大的棋盘格子上,每个格子在每个指定的"代"有 生,死两种关态, 有下面几条规则来说明一个格子如果从一代进化到一下代后的状态。这些规则是由格子以及其邻居格子的状态决定的。每个格子有8个邻居(参考windows挖雷游戏)
1. A live cell with fewer than two live neighbors dies.
一个活的格子如果有少于两个的活的邻居格子,则死
2. A live cell with more than three live neighbors also dies.
一个活的格子如果有多于三个的活的邻居,则死
3. A live cell with exactly two or three live neighbors lives.
一个活的格子如果有2个或3个活的邻居,则活
4. A dead cell with exactly three live neighbors becomes alive.
一个死的格子如果有3个活的邻居,则复活
Part A: Implementing Evolution (In-Lab)
简要的说就是写个程序实现这个游戏和规则。有a,b,c,d,e等要求,自已慢慢看吧。