Game of Life 生命遊戲 (I)

Conway’s Game of Life is a kind of cellular automation. It is a kind of zero-player game and it let the player to devise or modify the pattern of the cells and observe the evolution of the cells. (Wikipedia)

康威的生命遊戲是一種類似模擬細胞生命的產生器,透過設計改變細胞的分佈圖形並模擬觀察細胞繁延的後代圖樣。(中文維基)

It has simple rules to control and evolve the cells. The rules are associated with the relationship of main cells and the surrounding eight cells :

  • Too much neighbour cells (bigger than 3 cells) around will cause the death of the main cell.
  • Less neighbour cells (smaller than 2 cells) around and the main cell died due to isolation and lacking nutrition.
  • Main cell will continue live on to next generation when there are only 3 or 2 neighbouring cells.
  • When there are 3 neighbouring cells alive which surrounded the dead cell, it will become alive again.

遊戲裡有包含一些規則控制這個環境裡的細胞繁延的方式,其中包含四條。每一條規則都是比較主要的細胞以及圍繞主細胞的八個細胞:

  • 當周遭的活細胞太多(多於三個)時造成壅擠所以主要的細胞會死亡
  • 當周遭的活細胞太少(少於四個)時,除了主要細胞因為被孤立而且缺乏營養,所以主要細胞會死亡
  • 當主要的細胞在剛剛好可以生存的狀態,也就是周遭的細胞只有兩個或三個的時候,主要細胞可以繼續存活到下一代
  • 當死亡的細胞周圍剛好有三個活細胞時,死亡的細胞會在下一代再度復活
Game of Life by Maxwell Alexius

Because of curiosity, I created the game and put it on CodePen. You can also play this game in my website. Playing with different patterns of life and the results are interesting. There are several patterns that can be discussed, such as the still patterns illustrated below which will remain still unless you add other cells to modify the pattern.

覺得這個設計非常的新奇,所以我做了一個生命遊戲放到CodePen這個平台上。你也可以從我的網站玩玩看這個遊戲。每一種不同的圖案會產出不同驚奇的結果,然後會有特定幾種圖案值得去探討。像是下圖羅列出穩定不會變化的圖形,不管在哪一個世代都會穩定存在著,除非你加入其他的細胞或抽調裡面的細胞,這個圖案就會再次隨著時間而變化。

Still Lives in Game of Life

However, there are much more interesting patterns to discuss, so I will present other types of life pattern in the next article. Have fun with Conway’s Game of Life =)

然而,我將會在下一篇文章列出更多不同以及新奇的細胞生命分佈圖以及類別。好好享受這個遊戲的帶給你的感受吧!


Recommended : HTML5 Canvas (I)

自薦文章:HTML5 Canvas (I)