Table of Contents

Name

Xlife - Conway's Game of Life for X, version 3.0

Syntax

xlife [-geometry string] [-bw width] [initial pattern file]

Description

brings up a single window in which the user may play the game of life.

The universe is effectivly unbounded (4.2 billion on a side) The algorithim uses hashed 8x8 boxes of cells, and computes the next generation by using lookup tables for added speed.

By default Xlife will run in a window taking up your entire screen. The -bw option allows you to pass Xlife the width of the borders created by your window manager, for use in the internal window size calculation.

The -geometry option sets the Xlife window size and position as per usual for X applications.

If possible, you should tell your window manager to create Xlife without a title bar; otherwise you will have to use -geometry to set the window's vertical size enough smaller than the default that the title bar doesn't crowd the bottom of the window off the screen.

Commands

8
Move your view of the universe up.
2
Move your view of the universe down.
6
Move your view of the universe right.
4
Move your view of the universe left.
5
Center the universe on the screen (based on average position of the cells).
.
Center the universe view on the cursor (also Button 2 in normal mode).
=,+
Zoom the view in, magnifying the area around the mouse cursor.
-
Zoom the view out.
g
Toggle running the game.
o
Step forward one generation.
S
Save the universe to a file adding extension .life.
l
Load (actually add to) the universe from a file with extention .life. This lets you overlay multiple saved states to make for some interesting effects. Loaded pattern is initially considered tentative, and may be manipulated in various ways before incorporating it into main pattern. Clear the universe if you want to start from scratch. Load assumes pattern is in last directory accessed.
h
(Hide) stop displaying after each generation, does not iconify.
c
Toggle showing of cell counts
?
Help for xlife.
!
Place random cells on the area of the universe on the screen.
r
Redraw the screen.
R
Change the rules in "stays alive on"/"born on" format. The standard rules are 23/3 (alive on two or three neighbors, birth on three neighbors for an empty cell).
N
Change the file's internal name.
A
Add comments.
V
View comments.
C
Clear the universe.
Q
Quit
f
Run at a fast speed (no delay)
m
Run at a medium speed
s
Run at a slow speed
p
Toggle running display of mouse position. Position is only for reference during a session, and does not effect coordinates of saved points.
O
Set current mouse position to be the origin of displayed coordinates.
G
Generate tentative loaded pattern for one or more steps.
U
Undo load of tentative pattern.
I
Force tentative pattern to be incorporated into main pattern (automatic with g, h, o, l, and W commands).
W
Write (and flush from memory) script of loaded patterns into a file with '.life' extension. When loaded, this script corresponds the earliest ancestor of current pattern that can be reconstructed from loaded patterns (does not included changes made with mouse). Origin of written pattern is mouse position when 'W' is typed.
D
Discard current load script, including any tentative pattern, but leave cell population intact. (Helpful for using an old pattern as a template to construct a load script).

Button Bindings in Normal Mode

1
Activate a cell at the cursor.
2
Center the universe view on the cursor.
3
Delete a cell at the cursor.

Button Bindings with Tentative Pattern Loaded

1
Move pattern to current position.
2
Flip pattern about its x-axis.
3
Rotate pattern clockwise about its origin.

Load File Format

A .life image file is an ordinary text file consisting of lines terminated by the newline character. It is interpreted as one or more image sections separated by section lines beginning with '#'. Lines led by `##' are considered comments and ignored.

Each image section is interpreted according to the format letter following its section line #. The format letters are:

A -- Absolute. Each line is interpreted as an absolute (x,y) coordinate pair.

R -- Relative. Each line is interpreted as a relative (x,y) coordinate pair.

P -- Picture. Each line in the section is interpreted as a scan line of a relative image. Each '*' character turns the corresponding bit on. All other characters leave the corresponding bit off.

I -- Include. A #I line should have whitespace-separated fields after the #I consisting of a pattern name and five optional integer parameters (x, y offsets, rotation, flip, and delay as defined in the document NEWINCLUDE). The named pattern is loaded as if it had been included in the image at this point with the given transformation applied. The offsets, if present, displace the load point of the pattern relative to the current mouse position. The include facility is useful for assembling `sampler' collections of interesting patterns, as well as maintaining structured representations of complex patterns.

B and E -- Pattern blocks. Patterns enclosed by #B <name> and #E lines are skipped when loading a whole file, but may be accessed by adding :<name> to the file name. They are useful for bundling related patterns into the same file. Access is by sequentially skipping lines not in the block, so excessive numbers of blocks in the same file may slow down the loading process. Pattern blocks may not be nested.

Relative image sections are normally drawn with 0,0 on the current mouse position (coordinates may be negative). This may be changed by including a pair of whitespace-separated integers after the format character. If this is done, these will be interpreted as a pair of x and y offsets, and the image section will be drawn with its upper left corner displaced from the cursor position by those offsets. This facility can be used to write image files that will load patterns centered on the cursor.

A leading image section with no header line is treated as though it had a `#A' header. Thus, version 1.00 image files will load properly.

N -- Name This line contains the internal name of the pattern (which may differ from the XXX.life name of the file.

O -- Owner This line contains information on the person who wrote the file, it is written in the form: id "name"@machine date, for example.

#O jb7m "Jon C. R. Bennett"@sushi.andrew.cmu.edu Fri Jan

12 18:25:54 1990

C -- Comment Lines begining with "C" are comments that the user may have automaticaly writen to the save file, and which may be viewed from withen Xlife.

More section formats may be added in the future.

Restrictions

Old files in #P format may not have same y coordinate when read by the new release. For best results, use "oldpconv name ..." on old files.

Authors

Algorithm, implementation and file format enhancements:    Jon Bennett jcrb@cs.cmu.edu

Original X code:    Chuck Silvers cs4n@andrew.cmu.edu

Auto-sizing, X options and load format enhancements:    Eric S. Raymond (eric@snark.uu.net)

Enhancements to #I format and user interface:    Paul Callahan (callahan@cs.jhu.edu)

See Also

xtrek(6)


Table of Contents