Introduction
Some .lif files have the layout of
Life 1.05 but no #Life line.
They hold a pattern drawn with . and *, sometimes with a
#P line to say where it goes, a comment, or nothing else. The 33
patterns in PATTERNS.ZIP that came with Dave Crawford’s Windows program Get a Life
(version 1.0, 1993), and the logo file GETALIFE.LIF that the program shows when it
starts, are of this kind.
Get a Life’s own help says only that its pattern files are text “in which empty
squares are represented by ‘.’ and filled squares by ‘*’”, with the default
extension .LIF, and that a loaded pattern is centred on the screen. Which
of the lines below the program reads is not in its documents, so what follows is what
the files contain.
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.
Lines
| Line | Meaning |
|---|---|
#P x y | Where the block of rows goes: the upper-left corner, as in Life 1.05. Present in 27 of the 33 patterns; each file has one block. |
## text | A comment. One file, ACORN.LIF, has ## converted to new format by oldpconv. |
#O text | A name. One file, WIDESHIP.LIF, has #O jb7m Jon C. R. Bennett and no #P line. |
.**.* | A row: . is a dead cell and * a live one. |
The other directives of Life 1.05, #D, #N and #R,
may appear and are read as in Life 1.05, but no file here has one.
1Comment lines optional0 or more lines2Position#P x y, optional0 or 1 line3Rows dots and stars1 or more lines
Rows
In the 33 patterns the rows are all as wide as the pattern: shorter rows are padded with dots, so each is a full line of the picture (50 characters is the widest). The explorer does not need that: a row that stops early has dead cells after it. A line of no characters is ignored and does not move the next row down, as in Life 1.05. No file has one.
With no #P line, the file says nothing about where its pattern goes. Get
a Life centres it. The explorer draws it with its upper-left cell at 0, 0 and says that
the file gives no position.
A worked example
GLIDER.LIF from PATTERNS.ZIP (Old Zips, 1993): 25 bytes.
00000000 23 50 20 2D 31 20 2D 31 0D 0A 2E 2E 2A 0D 0A 2A #P -1 -1....*..*
00000010 2E 2A 0D 0A 2E 2A 2A 0D 0A .*...**..
| Offset | Bytes | Line | Meaning |
|---|---|---|---|
| 0x00 | 10 | #P -1 -1 | A block with its upper-left corner at x −1, y −1. |
| 0x0A | 5 | ..* | Row y = −1: a cell at x = 1. |
| 0x0F | 5 | *.* | Row y = 0: cells at x = −1 and 1. |
| 0x14 | 5 | .** | Row y = 1: cells at x = 0 and 1. |
A glider: five cells, a 3 × 3 box around the origin.
How the explorer takes a file
A file is read as this format when it does not begin with #Life, every
line is empty, starts with # or is made of . and
* only, and there is at least one row. Anything else is another variant or
damaged. A #P line that is not followed by two numbers, or a
character other than . and * in a row, makes the file damaged
rather than another variant. The 34 different files on the Mac, GETALIFE.LIF and the
33 patterns, are all read without a note.
This reference is partial: what the files contain is described, but no document that describes the format itself is on the Mac, so how each program reads the lines, especially the absence of a position, is not checked.
Not described
This is what the reference leaves out and what the viewer does not do.
- Reference: no document describes this layout. Which lines Get a Life reads, how it treats a missing
#Pline beyond centring, and where the layout came from are not known. - Reference:
#D,#Nand#Rin a file with no version line are assumed to mean what they mean in Life 1.05; no file here has one. - Viewer: it draws only the first generation and does not run the rules.
- Viewer: with no
#Pline it draws the pattern with its corner at 0, 0, not centred as Get a Life does.
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)
- Golly – free Game of Life program that opens Life pattern files (Windows, macOS, Linux)