Skip to content

This is a Python implementation of Conway's Game of Life using the Pygame library. The Game of Life is a cellular automaton. It is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input.

Notifications You must be signed in to change notification settings

Umang-Lodaya/Conway-Game-of-Life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Conway's Game of Life

This is a Python implementation of Conway's Game of Life using the Pygame library. The Game of Life is a cellular automaton devised by the British mathematician John Horton Conway in 1970. It is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input.

Getting Started

To run the Game of Life on your local machine, follow these instructions:

Prerequisites

Make sure you have Python 3.x installed on your system.

Installation

  1. Clone the repository to your local machine: git clone https://github.com/Umang-Lodaya/Conway-Game-of-Life.git
  2. Navigate to the project directory: cd Conway-Game-of-Life
  3. Install the required dependencies using pip: pip install -r requirements.txt

Usage

Run the main Python script to start the Game of Life: python main.py

Controls

  • Space Bar: Pause/Resume the simulation.
  • Left Mouse Button: Draw living cells on the grid.

Features

  • Grid Display: Visualizes the grid with living and dead cells.
  • Pause/Resume: Allows pausing and resuming the simulation.
  • Interactive Drawing: Enables users to draw living cells with the mouse.

Customization

You can customize various aspects of the simulation by modifying the following parameters in the main.py script:

  • Screen Size: Change the dimensions of the game window by modifying the SCREEN_SIZE constant.
  • Cell Size: Adjust the size of individual cells by modifying the CELL_SIZE constant.
  • Colors: Modify the colors used for the background, grid, living cells, and next generation cells by changing the corresponding color constants.

Implementation Details

  • The game grid is represented as a 2D numpy array.
  • Pygame library is used for creating the graphical interface.
  • Cells follow Conway's rules for birth, survival, and death.
  • Cells are updated in each generation based on their neighbors.

Contributing

Contributions are welcome! Feel free to open issues or pull requests for bug fixes, improvements, or new features.

About

This is a Python implementation of Conway's Game of Life using the Pygame library. The Game of Life is a cellular automaton. It is a zero-player game, meaning that its evolution is determined by its initial state, requiring no further input.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published