Implementation of the Conway's Game of Life in Python.
- Clone this repository.
- Run
game-of-life.py FILE
, whereFILE
is the input game. - The script periodically prints the game and updates it.
A game is a text file containing a rectangular lattice, where x
denotes a live cell and
(space) denotes a dead cell.
Example:
xxx xxx
x x x x
x x x x
x x x x
xxx xxx
xxx xxx
x x x x
x x x x
x x x x
xxx xxx
For more examples, see the games
directory.
The script's code is covered by unit tests. To execute them, simply run make test
. It will run the tests by using nosetests, so make sure you have it installed.
If you want to generate code coverage, run make test-coverage
and open coverage/index.html
in your favorite web browser. Once again, you need to have nosetests installed.
Copyright 2014 Daniela Ďuričeková daniela.duricekova@protonmail.com
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.