Skip to content

A Python-based Game of Life simulator with dynamic visualization, interactive controls, and the inclusion of the iconic Gosper Glider Gun pattern.

License

Notifications You must be signed in to change notification settings

vivekkdagar/conway_engine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The package is not available on PyPi currently. More information will be posted shortly.

Game Of Life

Welcome to the `conway_engine`, a visual representation of Conway's Game of Life—a cellular automaton designed by mathematician John Conway. This package showcases a grid of cells that evolve over time based on specific rules, resulting in intriguing patterns and behaviors.

The entry point game-of-life not working on Windows based systems is a known issue.

📔 Table of Contents

  1. Screenshots
  2. Requirements
  3. Features
  4. Installation
  5. Keyboard Commands
  6. FAQ
  7. Acknowledgements

📷 Demo Screenshot

image

🌟 Requirements

Ensure you meet the following requirements before installation:

  • Python: The simulation is written in Python. Download and install Python from python.org.

  • Pygame: The Pygame library is used for graphics and interaction. Install it using:

    pip install pygame

🎯 Features

  • Gosper Glider Gun: Experience the inclusion of the renowned Gosper Glider Gun, a pattern triggering gliders in a repeating sequence, resulting in explosive growth.
  • Dynamic Visualization: Observe a window displaying the evolving patterns of cells over time, creating visually striking designs.
  • Interactive Controls: Interact with the simulation by toggling cell states with mouse clicks and using keyboard commands to control the simulation.

🧰 Usage

🏃 Install from PyPI

You can install the conway_engine package directly from PyPI using the following command:

pip install conway-engine

🏃Build from source

  1. Clone the project
git clone <repository_url>
  1. Navigate to the root directory of the cloned repository.
cd conway_engine
  1. Build the package using the commands below.
python3 setup.py sdist bdist_wheel
  1. Install the package using pip.
pip install dist/*.tar.gz
  1. After installation, run the simulation by typing the following command in the terminal:
game-of-life

🧰 Command-line Arguments

Use the command-line option to access additional documentation on the GitHub README page:

game-of-life --i

⌨️ Keyboard Commands

  • Spacebar: Start/Pause the simulation.
  • 'c' Key: Clear the grid.
  • 'g' Key: Generate a random set of cells for explosive growth.
  • Mouse Left Click: Toggle the state of a cell.
  • Mouse Right Click: Remove a cell.

FAQ

  • Q1: What is the Game of Life by John Conway?

    • The Game of Life is a cellular automaton created by mathematician John Conway. It consists of a two-dimensional grid where each cell can be alive or dead. The evolution of the grid is determined by simple rules, including underpopulation, survival, overpopulation, and reproduction.
  • Q2: What are the rules of the Game of Life?

    • The rules of the Game of Life are: Underpopulation, Survival, Overpopulation, and Reproduction. These simple rules give rise to a variety of patterns, including stable structures, oscillators, and gliders, making the Game of Life a fascinating and widely studied cellular automaton.

💎 Acknowledgements

  • John Conway's Game of Life: The entire codebase is built upon the principles of John Conway's Game of Life. The rules governing cell evolution, the grid-based structure, and the concept of cellular automata are all inspired by Conway's seminal work in the field of mathematical games and automata theory.

  • Gosper Glider Gun Pattern: The implementation of the Gosper glider gun pattern, a well-known configuration in Conway's Game of Life, adds complexity and visual interest to the simulation. The Gosper glider gun is famous for generating gliders, which contribute to the emergence of diverse patterns and behaviors.

  • GenReadme: Used GenReadme to generate documentation effectively and efficiently.

  • Pygame Library: Leveraging the Pygame library for graphics and user interaction streamlines the development of the Game of Life simulation, providing a robust framework for handling events, drawing the grid, and creating an engaging visual experience for users.

About

A Python-based Game of Life simulator with dynamic visualization, interactive controls, and the inclusion of the iconic Gosper Glider Gun pattern.

Topics

Resources

License

Stars

Watchers

Forks

Languages