Introduction
The simplest .lif file is a picture of the pattern in letters: an
x where a cell is alive and a space where it is not, one line for each
row. There is no first line, no rules and no position. Four patterns of the
collection that came with Dave Crawford’s Windows program Get a Life (version 1.0,
1993) are written this way: EXPLODES.LIF, LONGLIFE.LIF, NEWGUN.LIF and
PUFFERA.LIF. The rest of the collection uses . and *, as
the files with no version line do.
No document on the Mac describes this style, so this page is what the four files show and is marked partial. It is not known which program wrote it or read it.
A file dropped on this page opens in the explorer as a picture of the pattern with its live cells, bounding box and density, and the pattern written out as text. Each cell is linked to its byte.
Rows
| Character | Meaning |
|---|---|
x | A live cell |
| space | A dead cell |
| empty line | A row of dead cells |
| anything else | Not this format. The explorer does not take the file as an x grid. |
The first character of the first line is the pattern’s upper-left cell, and every
line is the next row down. Rows are not padded: a row ends at its last
x, or is empty. A line of spaces is also a row of dead cells.
An empty line is a row of dead cells here, where in Life 1.05 it is ignored. That is the reading that makes the files draw sensibly: in NEWGUN.LIF and PUFFERA.LIF the blank lines separate the parts of the pattern (two copies of one spaceship in PUFFERA, with 14 rows between their first lines), and read as ignored they would run those parts together. It is a judgment from how the files look, and has not been checked against a program that reads them.
The file says nothing about where the pattern goes. The explorer draws it with its upper-left cell at 0, 0 and says that the file gives no position.
0Rowsxand spaces, one line a row1 or more lines
A worked example
LONGLIFE.LIF from Get a Life’s PATTERNS.ZIP (Old Zips, 1993): 15 bytes.
00000000 78 20 78 0D 0A 78 20 78 0D 0A 78 78 78 0D 0A x x..x x..xxx..
| Offset | Bytes | Line | Meaning |
|---|---|---|---|
| 0x00 | 5 | x x | Row 0: cells at x = 0 and 2. |
| 0x05 | 5 | x x | Row 1: cells at x = 0 and 2. |
| 0x0A | 5 | xxx | Row 2: cells at x = 0, 1 and 2. |
Seven cells in a 3 × 3 box, a density of 77.8%.
How the explorer takes a file
A file is read as an x grid when every line holds only x and spaces and
at least one x is in the file. A file that starts with #Life,
or has a # line, a . or a *, is another variant
or damaged. The four files on the Mac are read without a note.
Not described
This is what the reference leaves out and what the viewer does not do.
- Reference: no document describes this style. Which program wrote or read it, and whether a blank line is a row of dead cells, are not known; the blank-line reading is inferred from how NEWGUN.LIF and PUFFERA.LIF look.
- Reference: tabs, capital X and other characters are not described; the explorer does not accept them.
- Viewer: it draws only the first generation and does not run any rules.
- Viewer: the pattern is drawn with its upper-left cell at 0, 0 because the file gives no position.
Variants
- Life 1.05 pattern – a version line, description, rules and cell blocks of dots and stars
- Life 1.06 pattern – a version line and one live cell a line, as two numbers
- Life pattern without a version line – the Life 1.05 layout with no first line, and bare grids of dots and stars
- Life pattern (x grid) – rows of x and spaces with no header
Links
Software
- Get a Life – Dave Crawford’s Game of Life for Windows 3, which came with these files (Windows)