This package is a Python implementation of Conway's Game of Life,a cellular automaton devised by the British mathematician John Horton Conway in 1970. The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.
Project description
Conway's Game of Life in Python
This project is a Python implementation of Conway's Game of Life, a cellular automaton devised by the British mathematician John Horton Conway in 1970. The game is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input. One interacts with the Game of Life by creating an initial configuration and observing how it evolves.
Introduction
The Game of Life is not your typical computer game. It consists of a grid of cells which, based on a few mathematical rules, can live, die or multiply. Depending on the initial conditions, the cells form various patterns throughout the course of the game.
The packages is available on PyPI: https://pypi.org/project/game-of-life-YETIYETYET/
Rules of the Game
The universe of the Game of Life is an infinite two-dimensional orthogonal grid of square cells, each of which is in one of two possible states, alive or dead. Every cell interacts with its eight neighbours, which are the cells that are horizontally, vertically, or diagonally adjacent. At each step in time, the following transitions occur:
- Underpopulation: A live cell with fewer than two live neighbours dies.
- Stasis: A live cell with two or three live neighbours lives on to the next generation.
- Overpopulation: A live cell with more than three live neighbours dies.
- Reproduction: A dead cell with exactly three live neighbours becomes a live cell.
The initial pattern constitutes the seed of the system. The first generation is created by applying the above rules simultaneously to every cell in the seed, live or dead; births and deaths occur simultaneously.
Sample of the output project
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
Before running this project, you need to have Python installed on your system (Python 3.12 is recommended). You can download Python from the official website: https://www.python.org/downloads/
Installing
Clone the repository to your local machine: git clone https://github.com/YetiYetYet/game-of-life-python.git
Install the required dependencies :
pip install -r requirements.txt
Running the Game
To run the game, execute the following command in the terminal:
python main.py
Usage
- Run the main script.
- Follow the instructions in the terminal. It will ask to enter a size for the grid, a starting alive probability. By default, if you enter nothing, the size will be 10x40 and the starting alive probability will be 0.5.
- Watch the game evolve in your terminal.
Authors
- YetiYetYet - YetiYetYet
Questions/Contact
If you have any questions or concerns, please reach out to me at alexisbehier22@gmail.com.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for game_of_life_YetiYetYet-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2be4008214d8c14cf1a12ebb3f9a5e56a6a5688f4e9ea3d8b42a88b02dd004a4 |
|
MD5 | c01fcaf97ca8146df1552f6144211b60 |
|
BLAKE2b-256 | dec951ef24ff0d7665f09880c5e1754135e67cfbf706244e6a04eae1ed04291e |
Hashes for game_of_life_YetiYetYet-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9125a82c83dd6a6e458168e499ccf40b9fb0f874a1c2c5121bb32fbc54a619a |
|
MD5 | a3b706381de64707f8d2f1984fd69236 |
|
BLAKE2b-256 | 87e124626a06e034f8df6f56405219e3c13e3db2da1786b65dcf00815c1c746d |