Skip to content

harshcoder7/Conway-way-of-life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyGameofLife

python   MIT license   maintained  

# PyGameofLife

Overview

PyGameofLife is a simple implementation of Conway’s Game of Life using Python. It features a command-line interface that allows users to generate and customize animations of cellular automata. The focus is on readability and simplicity rather than performance optimization.

Installation

Dependencies

PyGameofLife requires numpy and matplotlib. Install them using:

pip install numpy matplotlib

Clone the Repository

To get the code, run:

git clone https://github.com/robertmartin8/PyGameofLife
cd PyGameofLife

Running the Simulation

To start the simulation with the default settings, run:

python life.py

This will generate an animation saved as infinite.gif in the current directory.

Command-Line Options

To see all available options, run:

python life.py --help

Main Options

  • --universe-size X,Y → Set the grid size.
  • -seed SEED_NAME → Choose a predefined seed pattern.
  • -n N → Define the number of iterations.
  • -interval TIME → Set the time interval (in ms) between updates.
  • -quality DPI → Adjust the image quality.
  • -cmap COLOR_MAP → Change the color scheme.
  • --seed-position X,Y → Set the initial position of the seed.

Example Commands

Run the simulation with a predefined seed:

python life.py -seed diehard

Run with a smaller grid and custom colors:

python life.py -seed beacon --universe-size 6,6 --seed-position 1,1 -cmap plasma_r

Customizing Seeds

Seeds are predefined patterns. The available options include diehard, boat, r_pentomino, beacon, and more. To add a new seed, modify the seeds dictionary in life.py.

About

This project is designed as an educational tool to demonstrate cellular automata using Python. The code prioritizes readability and intuitive design over efficiency.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages