Skip to main content

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:

  1. Underpopulation: A live cell with fewer than two live neighbours dies.
  2. Stasis: A live cell with two or three live neighbours lives on to the next generation.
  3. Overpopulation: A live cell with more than three live neighbours dies.
  4. 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

Demo GameOfLife

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

  1. Run the main script.
  2. 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.
  3. Watch the game evolve in your terminal.

Authors

Questions/Contact

If you have any questions or concerns, please reach out to me at alexisbehier22@gmail.com.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

game_of_life_YetiYetYet-0.1.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

game_of_life_YetiYetYet-0.1.0-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file game_of_life_YetiYetYet-0.1.0.tar.gz.

File metadata

  • Download URL: game_of_life_YetiYetYet-0.1.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.18

File hashes

Hashes for game_of_life_YetiYetYet-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2be4008214d8c14cf1a12ebb3f9a5e56a6a5688f4e9ea3d8b42a88b02dd004a4
MD5 c01fcaf97ca8146df1552f6144211b60
BLAKE2b-256 dec951ef24ff0d7665f09880c5e1754135e67cfbf706244e6a04eae1ed04291e

See more details on using hashes here.

File details

Details for the file game_of_life_YetiYetYet-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for game_of_life_YetiYetYet-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e9125a82c83dd6a6e458168e499ccf40b9fb0f874a1c2c5121bb32fbc54a619a
MD5 a3b706381de64707f8d2f1984fd69236
BLAKE2b-256 87e124626a06e034f8df6f56405219e3c13e3db2da1786b65dcf00815c1c746d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page