Saturday, 22 December 2012

PYGAME - "Game of Life"

             The Game of Life is a cellular automation concept by the mathematician John Horton Conway. The system is simple and interesting. It is not like a conventional game, that is there is no players, and no winnings or losing. The game is a zero- player game, meaning that its evolution is determined by its initial state, requiring no further input. Once the "pieces" are placed in the starting position, the rules determine everything that happens later. In this game it is impossible to look at the starting pattern of the game. The pattern randomly changing as per the rules. the only way to find what will happen in the future is the follow the rules of the game

Rules of the Game of Life

               Game of Life is played on an infinite two-dimensional grid of square cells like a chess board. Each of this cell is in one of two possible state live or dead. A Live cell is shone by a square filled with black colour, a Dead cell is shone by a square filled with white colour. every cell interact with eight niborous cells, which are the cells that are horizontal, vertical and diagonally adjacent.
 


The rules determines the next state of each cell according to the current state of the cell and number neighboring live cells. the rules are given below

1) A dead cell with exactly three live neighbors become a live cell(Birth)





2) A live cell with two or three live neighbors stays alive(survival)
     




3) Any live cell with fewer than two live neighbors dies, as if   caused by under population
   



4) Any live cell with more than three live neighbors dies,as if by overcrowding




                The initial pattern constitutes the seed of the system. The first generation iscreated by applying the above rules simultaneously to every cell in the seed,births and deaths occur simultaneously, and the discrete moment at which this happens is sometimes called a tick (in other words, each generation is a purefunction of the preceding one). The rules continue to be applied repeatedly to create further generations.