Skip to content

maesbrisa/game_of_life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

game_of_life

pytest

Another wibbily wobbly timey wimey...stuff related with Conway's game of life.

Rules

  1. Any live cell with less than 2 live neighbors dies (under population)
  2. Any live cell with 2 or 3 live neighbors lives (next generation)
  3. Any live cell with +3 live neighbors dies (over population)
  4. Any dead cell with 3 live neighbors becomes live cell (reproduction)

Example

stage_0 = [[0,1,1],[0,0,1],[0,0,0]]
stage_1 = [[0,0,1],[0,0,0],[0,0,0]]

How to test it

There is a simple interface to enter the matrix values and test all phases until there is no live cell.

python game_of_life.py

Here is a input example:

Input example

About

Python 3 Game of Life implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages