This document is especially written for anyone who is writing a Life program that reads the patterns in the lifep.zip collection. Note that while it is easy to read Life 1.05 formatted files, it is difficult when writing the files to choose appropriate cell blocks. Life 1.05 therefore does not make an easy output file format, except for small patterns.

Details of the Life 1.05 file format:

The extension should be ".lif".

The first line always identifies the kind of format it uses, for compatibility purposes:

#Life 1.05
where 1.05 is the current format version number. A lower number is acceptable, and a higher number means that something may be outside these specifications. 1.05 is the latest.

The "#Life" line is followed by optional description lines, which begin with "#D" and are followed by no more than 78 characters of text. Leading and trailing spaces are ignored, so the following two "#D" lines are equivalent:

#D This is a Description line
#D    This is a Description line   
There should be no more than 22 "#D" lines in a .lif file.

Next comes an optional rule specification. If no rules are specified, then the pattern will run with whatever rules the Life program is currently set to. The patterns in the collection here enforce "Normal" Conway rules using the "#N" specifier. Alternate rules use "#R" ("#N" is exactly the same as "#R 23/3").

Rules are encoded as Survival/Birth, each list being a string of digits representing neighbor counts. Since there are exactly eight possible neighbors in a Conway-like rule, there is no need to separate the digits, and "9" is invalid in both lists.

For example,

#R 125/36
means that the pattern should be run in a universe where 1, 2, or 5 neighbors are necessary for a cell's survival, and 3 or 6 neighbors allows a cell to come alive.

Next come the cell blocks. Each cell block begins with a "#P" line, followed by "x y" coordinates of the upper-left hand corner of the block, assuming that 0 0 is the center of the current window to the Life universe.

This is followed by lines that draw out the pattern in a visual way, using the "." and "*" characters (off, on). Each line must be between 1 and 80 characters wide, inclusive; therefore, a blank line is represented by a single dot, whereas any other line may truncate all dots to the right of the last "*". There is no limit to the number of lines in a cell block.

Any line of zero length (just another carriage return) is completely ignored. Carriage returns are MSDOS-style (both 10 and 13).

About Xlife compatibility:

Xlife recognizes the symbol "#C" for a comment, instead of "#D". The default extension is ".life" instead of ".lif". Wlife (a port of Xlife for Microsoft Windows 3.1) does not have these compatibility problems.