The Game of Life project implements John Conway's famous cellular automaton, using a representation of a world of cells and the rules that govern their evolution. This project makes it possible to run the game of life on a grid of cells and simulate its evolution over several generations.
Before you start, make sure you have the following installed:
- Python 3.9+
- Poetry for dependency and script management
To install the project and its dependencies, follow the steps below:
-
Clone this repository:
git clone https://github.com/EricBurnett/GameOfLife.git cd GameOfLife -
Install dependencies using Poetry :
poetry install
Run the project to watch the simualation:
cd gameoflife
poetry run python life.pyUp/Down/Left/Right: Pan the viewport
+/-: Speed up or slow down the rate of evolution
PageDown/PageUp: Zoom in/out
To ensure the quality and correctness of the project, follow the steps below:
- Make sure you have installed all dependencies with poetry install as described above.
- Unit Testing :
poetry run pytest
- Doctests :
poetry run python -m doctest -v life.py
- Linting :
poetry run pylint test - Automatically check and fix common issues before code is committed :
# Install pre-commit hooks pre-commit install # Optionally, run hooks on all files to ensure compliance pre-commit run --all-files
This project uses Sphinx to generate reference documentation from Python docstrings. Follow the steps below to generate the documentation:
- Install the project dependencies, including Sphinx:
poetry install
- Generate the HTML documentation :
poetry run make html
The generated documentation can be found in the docs/_build/html directory. Open index.html in your browser to view it.
This project is licensed under the GNU Lesser General Public License (LGPL-3.0-or-later). See the LICENSE file for details.
Copyright (c) 2011 Eric Burnett. Fork modifications (c) 2024 Romane.