Skip to content

This is a simulator of Conway's Game of Life. The underlying module is developed in C, and the GUI is written in Python.

Notifications You must be signed in to change notification settings

Marvel0usx/game-of-life

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

game-of-life

A visualization of 2D Conway's Game of Life based on CPython module and threaded GUI by tkinter.

Install and Run

Create a virtual environment and install dependencies. Microsoft Visual C++ 14.0 or greater is required.

python -m venv game
call ./game/Scripts/activate.bat
pip install . --use-pep517

Run the following command to create the interface:

python controller.py

The Game

The Game of Life is not a typical computer game. It is a 'cellular automaton', and was invented by Cambridge mathematician John Conway.

This game became widely known when it was mentioned in an article published by Scientific American in 1970. It consists of a collection 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 Rules

  • For a space that is 'populated':

    Each cell with one or no neighbors dies, as if by solitude.

    Each cell with four or more neighbors dies, as if by overpopulation.

    Each cell with two or three neighbors survives.

  • For a space that is 'empty' or 'unpopulated'

    Each cell with three neighbors becomes populated.

The Controls

Draw the figure that you want on the canvas. The left button on your mouse is drawing, and the right is erasing. After drawing the figure, click on start to begin the simulation. You can use scroll to zoom in and out, and use the widget at the bottom-right to adjust the speed of each generation.

Initiative

Try to write Python module in C, and study the interpreter of Python (2.7.8).

Screenshots

About

This is a simulator of Conway's Game of Life. The underlying module is developed in C, and the GUI is written in Python.

Topics

Resources

Stars

Watchers

Forks