Skip to content

2birds/gameOfLife

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

############################################################
############     G A M E   O F   L I F E     ###############
############################################################

			 # 
			  #
			###

V0.2

Updates: when creating your initial state, the coordinates 
where you click get printed to stdout. If you copy and paste
these into a plain text file, you can give the file name as
an argument when you launch the program and it will recreate 
the initial state. I have included gliderGun to demonstrate.

In addition to this, you can specify the size of the board
in terms of an integer representing the number of cells in
a side (the board is a square).
Python doesn't care which argument comes first, or if both
are present. It will default to a blank board of 55**2 cells.

Dependencies: the pygame module (freely available).

Overview: This implementation of Conway's Game Of Life 
consists of a class, gameOfLifeClass.py, and an interface to
it, gol.py, written using the pygame module. The comments in
gol.py indicate what to modify to change the board size and
refresh rate. All the logic and methods used to alter the
state of the board and its cells are in gameOfLifeClass.py
and so a different interface could be written quite easily.

How to make it go: make gol.py executable. If you aren't
using a unix-based system (why not???), you will need to alter 
(or just delete) the first line of both .py files so they point 
to the appropriate place. Finally, execute gol.py.

Usage: click to change the state of cells from live to dead
or dead to live. Black cells are live. Once you're happy with
your initial state, press 's' to start the process. Unless
you've altered the program yourself, it will display an 
updated once every 0.2 seconds. When you're bored, or it's 
finished, press 'q' to quit.

Implementation by Rob Hawkins. 2012 - The Heat Death of the 
Universe.

About

An implementation of Conway's Game Of Life in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published