-
Notifications
You must be signed in to change notification settings - Fork 0
/
README
46 lines (37 loc) · 1.85 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
############################################################
############ 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.