PLife is a lightweight implementation of
Conway's Game of Life and related cellular automata.
Those who are new to the Game of Life can refer to
Math.com Life Page
for an introduction into the subject.
PLife project page on Sourceforge.net.
PLife download page
(the latest release is 0.4.1).
The package includes two separate tools for viewing and creating Life patterns:
The pattern viewer has a simple (but functional, I hope) X11 interface (keyboard shortcuts and mouse, no widgets).
It runs a toroidal universe (2^19) x (2^19) cells and appears to be about 3 times
faster than XLife (regardless of pattern structure).
Pattern formats currently recognized are Life 1.05/1.06, RLE and David Bell's.
Many (but not all) Life patterns included in XLife distributions are also understood
('smart inclusion' of XLife files is not supported).
Here
is an overview of some popular CA file formats in existence.
Some other features of the viewer are:
- navigating through files specified on command line with PageUp/PageDown, just like in image viewers;
- zoom/unzoom from x12 to x1/8 pixels/cell, (not only) at a touch of mouse wheel;
- operations on rectangular blocks: clear, crop, solid/random fill and copy out in RLE format.
Note that once a block is copied to clipboard, it's next best place is in a pattern-describing script (see below!)
and not in that random point of the universe where you would paste it by hand.
Am I wrong? Anyway, there is no pasting in the GUI.
The typical look of the viewer is like this (the pattern displayed is from Jason Summers' main collection):
The tool for creating Life patterns has a form of a Python module
so that patterns can be described in Python scripts.
For details on using the module, see the samples and Python documentation included in the package,
while here is a mere example.
The following script (bricklayer.py)
produces exactly the above bricklayer.lif pattern:
from life import *
p22_half = pattern ("2o$bo$bobo$2b2o3bo$6bob2o$5bo4bo$6bo3bo$7b3o!")
p22 = p22_half + p22_half (26, 9, flip)
gun22 = p22 + p22[1] (-18, 11)
gun154 = gun22[27] + gun22[5] (49, 12, rcw) + gun22 (5, 53, flip_y)
p7_reflector = pattern ("""
2b2o5b2o$2b2o5bo$7bobo$7b2o$3b2o$3bobo$4bo3$13bo$10bo2b3o3b2o$3b5o
2b3o3bo2bo$b3obob3o4b2obobo$o4bo4b4obobo2b2o$2ob2ob4o3bobob2obo$
4bobobobobo2bo2bobo$4bobobo2bo2bob3ob2o$3b2obob4o6bobo$7bo4b6o2b
o$9bo2bo2bo4b2o$8b2o!""")
pre_lom = pattern ("2bo$2ob2o$2ob2o2$b2ob2o$b2ob2o$3bo!")
all = gun154[210] (-52, -38) + gun154[254] (52, -38, flip_x) + p7_reflector (8, 23) + pre_lom (-3, 30)
all.save ("bricklayer.lif", "David Bell, 29 Sep 2002")
As for highly non-straightforward algorithms,
one can get intrigued with the smart "HashLife" approach to evolving Life patterns,
which relies on regularity in pattern behaviour to achieve faster-than-linear speed
(so that finding N-th generation takes less than O(N) time!).
Simply speaking, it recognizes parts of the universe it has seen before and does not handle them twice.
Also a nice thing about HashLife is that its universe representation allows for universes of almost unlimited size.
HashLife is very efficient on huge and fairly regular patterns like
metacatacryst, but
in some sense it complements traditional "honest" ways of running Life,
as even a small pattern without regularity can be fatal for it.
HashLife implementations include
hashlife-1.5 by
David Ingalls Bell
and a thoroughly documented
hlife by Tom Rokicki.
One of afind's results is this incomplete period 6 knightship, which is probably of no use, however:
There is also another near-knightship, which has a distinct leading edge and whose 6-th generation
differs only in 3 cells (all in 2 trailing rows) from its translated copy
(3-cells-away.lif):
#C This pattern is only "3 cells away" from being a knightship. #C Its 6-th generation differs in 3 cells from the translated initial generation. #C Tue Mar 23 00:10:07 MSK 2004 x = 14, y = 19, rule = b3/s23 11bobo$6b2o2bo$6bob2o$5bo5b2o$bobo2bo$o$o3bo2b3ob2o$o3bo4bo$5bob2o$bo 3bob2o$2ob3o$4b2obo$2o2b3o$2obo$3b2o4b2o$b3o$2bo2b3ob2o$3b2o2b2o$4b3o!
Ever heard of the D programming language, conceived as a successor to C and C++?
Check the above pages for many more links!
[Last modified: 29 May 2004]