.TH xlife "" "" "X Application"
.PC "The game of bit manipulation"
\fBxlife [\fIpatternfile.life\^\fB]\fR
.PP
.B xlife
brings up a window in which you can play Conway's game of life.
.PP
The game of life is the first example of what has become a thriving
sub-speciality of computing and mathematics:
the construction of ``artificial life'' within computers.
In brief, the game imagines a two-dimensional, unbounded universe.
The universe is divided into cells.
At the beginning of the game,
some cells initialized to on (or ``alive''); the rest are off (or ``dead'').
Time is divided into generations.
With each generation, the pattern of cells that are alive and dead
changes by the following rules:
.IP \(bu 0.3i
If a live cell has fewer than two living neighbors, it does of loneliness.
.IP \(bu
If a live cell has two or three living neighbors, it remains alive.
.IP \(bu
If a live cell has more than three living neighbors, it dies of crowding.
.IP \(bu
If a dead cell has three living neighbors, it comes to life.
.PP
The game constantly recomputes pattern of living and dead cells, and
displays them.
As the generations pass, the cells tend to coalesce, mutate, and ``grow''
in a manner that mimics those seen in nature.
.PP
In this implementation,
the universe has 4.2 billion-squared cells.
Its algorithm uses hashed eight\(mueight boxes of cells,
and computes the next generation by using lookup tables for added speed.
.SH Commands
While the game is quiescent (that is, it is not computing new generations),
you can press the mouse buttons to alter the screen.
Pressing the left mouse button turns a cell on.
Pressing the right mouse button turns a cell off.
Pressing the center mouse button moves the cells to the center of the window.
.PP
.B xlife
also recognizes the following keyboard commands.
Note that when
.B xlife
is not quiescent (that is, when it is computing new generations of cells),
it recognizes only the
.B g
key:
.IP \fB8\fR 0.3i
Shift your view of the universe up.
.IP \fB2\fR
Shift your view of the universe down.
.IP \fB6\fR
Shift your view of the universe to the right.
.IP \fB4\fR
Shift your view of the universe to the left.
.IP \fB5\fR
Center the universe on the screen, based on average position of the cells.
This is the same as pressing the center mouse button.
.IP \fB=\fR
.IS \fB+\fR
Zoom the view in.
Note that when you zoom in, you may also need to shift your view of
the cells to keep them within view.
.IP \fB\-\fR
Zoom the view out.
.IP \fB?\fR
Display a help message.
.IP \fB!\fR
Place random cells on the area of the universe on the screen.
.IP \fBC\fR
Clear the universe.
.IP \fBg\fR
Toggle running the game.
.IP \fBh\fR
Hide:
stop displaying after each generation.
Do not iconify the window.
.IP \fBl\fR
Load the contents of a file to the universe.
.B xlife
prompts you on its information line for the name of the file.
By default, life's pattern files are kept in directory
.BR /usr/games/lib/xlife .
Note that the contents of the file are added what is already on the
screen.
This lets you overlay multiple patterns to create some interesting
effects.
If you want to start from scratch, you must first press
.B C
to clear the universe
explicitly.
.IP \fBo\fR
Step forward one generation.
.IP \fBQ\fR
Quit
.BR xlife .
.IP \fBR\fR
Change the rules by which cells stay alive and are born.
The format is ``stays alive on/born on'', with each being a single-digit
integer.
The standard rules are ``23/3'' \(em that is, a cell stays alive when it
has two or three neighbors, and is born when it has exactly three neighbors.
.IP \fBr\fR
Redraw the screen.
.IP \fBs\fR
Save the universe to a file.
.B xlife
prompts you on its information line for the name of the file.
After you enter the name, it automatically appends suffix
.B .life
to the file name.
.SH "See Also"
.B
X applications
.R
.SH Notes
Under \*(CO,
The default size of the screen has been reduced from 1000\(mu768 to
500\(mu384, so it will fit onto the lower-resolution screens used by
many \*(CO
.\" employees and
customers.
Note that the patterns included in
.B /usr/games/lib/xlife
were built on the larger screen, so after you load them you
will have to press the
.B 6
and
.B 2
keys to bring them into view.
.PP
.B xlife
does not use much of the standard X toolbox.
This makes the executable smaller, but it also means that many of
the standard command-line arguments and resource settings have
no effect on it.
.PP
.B xlife
does not yet work under \*(OL.
This is because
.B xlife
never surrenders control of the mouse cursor, and so
never permits \*(OL to redirect keyboard input into the
.B xlife
window.
However,
.B xlife
works fine under
.BR twm .
It has not yet been tested under
.BR fvwm .
.PP
.II "Bennett, Jon"
.II "Silvers, Chuck"
The algorithm and implementation of
.B xlife
were written by
Jon Bennett (jcrb@cs.cmu.edu).
The original X code was written by
Chuck Silvers (cs4n@andrew.cmu.edu).
