请教一个初级的 Game of Life编程 不需要applet 是用array表示出来图形的变化
> java LifeGeneration: 0. . . . . . . 
. . * . . . . 
. . . * . . . 
. * * * . . . 
. . . . . . . 
. . . . . . . Continue? (y/n): 
yGeneration: 1. . . . . . . 
. . . . . . . 
. * . * . . . 
. . * * . . . 
. . * . . . . 
. . . . . . . Continue? (y/n): 
yGeneration: 2. . . . . . . 
. . . . . . . 
. . . * . . . 
. * . * . . . 
. . * * . . . 
. . . . . . . Continue? (y/n): 
yGeneration: 3. . . . . . . 
. . . . . . . 
. . * . . . . 
. . . * * . . 
. . * * . . . 
. . . . . . . Continue? (y/n): 
yGeneration: 4. . . . . . . 
. . . . . . . 
. . . * . . . 
. . . . * . . 
. . * * * . . 
. . . . . . . Continue? (y/n): 
n
> 如图所示 请高手帮忙看看写写

解决方案 »

  1.   

    The GameThe Game of Life is not your typical computer game. It is a 'cellular automaton', and was invented by Cambridge mathematician John Conway.This game became widely known when it was mentioned in an article published by Scientific American in 1970. It consists of a collection of cells which, based on a few mathematical rules, can live, die or multiply. Depending on the initial conditions, the cells form various patterns throughout the course of the game.The RulesFor a space that is 'populated':
        Each cell with one or no neighbors dies, as if by loneliness. 
        Each cell with four or more neighbors dies, as if by overpopulation. 
        Each cell with two or three neighbors survives. 
    For a space that is 'empty' or 'unpopulated'
        Each cell with three neighbors becomes populated. 参考:http://www.bitstorm.org/gameoflife/把这些说清楚,问题不就变得很简单了吗?