Introduction
Life 1.05 is the pattern file of Alan Hensel’s Game of Life collection, which came
with his MS-DOS program Life 1.06 and was read by Xlife, WinLife, WLife and LifeLab as
well. It is text. The first line says #Life 1.05; lines that start with
# give a description, the rules and where each block of cells goes; and
the other lines draw the live cells, * for a cell that is alive and
. for one that is not. This page is the format as the collection’s own
description, WRITERS.DOC, gives it, checked against the 150 different files of the
collection.
The program called Life 1.06 is not the file format called Life 1.06. The program reads and writes Life 1.05 files. The Life 1.06 format is a different thing.
A file dropped on this page opens in the explorer as a picture of the pattern, its live cells, bounding box and density, the description, the rules, a table of cell blocks, and the text of the pattern, with each cell linked to its byte.
Lines
A file is a list of lines. Each ends with a carriage return and a line feed, “MS-DOS style” in the description, though the explorer also reads a bare line feed or carriage return. A line of no characters at all is ignored. Every other line is one of these:
| Line | Where | Meaning |
|---|---|---|
#Life 1.05 | The first line | The version line. |
#D text | After the version line | A description line, up to 22. |
#N | Before the first block | Normal Conway rules. |
#R 23/3 | Before the first block | Rules as survival and birth digits. |
#P x y | Starts each block | The block’s position, two whole numbers. |
.**..* | After a #P | A row of the block: only . and *. |
1Version line#Life 1.051 line2Description#Dlines, optional0 to 22 lines3Rules#Nor#R, optional0 or 1 line4Cell blocks each a#P x yline and its rowsany number
The version line
The first line of the file always names the format, so that a program can tell what
it is reading. The standard is #Life 1.05, where 1.05 is the format’s
version number. The description says a lower number is acceptable and a higher number
means something may be outside the description. The explorer reads any lower number
as it reads 1.05 (the first version line, #Life 1.03, was added by
version 1.03 of the program, according to its history), reads a higher one as 1.05
with a note, and reads exactly 1.06 as the different
Life 1.06 format.
A file with no version line at all has the same layout: Life pattern without a version line.
Description lines
#D is followed by up to 78 characters of text. Leading and trailing
spaces are ignored, so #D This is a Description line and
#D This is a Description line are the same. A file should have at
most 22. They are free text for people; an empty one, #D and a space, is
used as a blank line between paragraphs.
Two further lines turn up in files and are not in the description: #C,
Xlife’s comment, which the description says Xlife recognises where Life 1.05 has
#D, and #O, which one file of the Get a Life collection,
WIDESHIP.LIF, uses for a name (#O jb7m Jon C. R. Bennett). The explorer reads
#C and ## as comments and #O as the owner, and
notes any other directive as one it does not know. What a Life program does with
them is not documented here.
Rules
The rule line is optional. With no rule, the pattern runs with whatever rules the
program is set to. The files of the collection all say #N, which is
exactly the same as #R 23/3: Conway’s own rules.
#R is followed by two lists of digits with a slash between them:
survival, then birth. Each is a string of digits for neighbour counts, with no
separators, because a cell has at most 8 neighbours. The digit 9 is not allowed in
either list. For example #R 125/36 says that a live cell with 1, 2 or 5
live neighbours stays alive and that a dead cell with 3 or 6 live neighbours comes
alive. In 23/3 a live cell with 2 or 3 neighbours survives, and a dead
cell with exactly 3 is born.
| Line | Survive with | Born with |
|---|---|---|
#N | 2, 3 | 3 |
#R 23/3 | 2, 3 | 3 |
#R 125/36 | 1, 2, 5 | 3, 6 |
#R /2 | none | 2 |
No file on the Mac has a #R line, so the digit order and the empty list
in the last row are read from the description alone and not checked on real
files.
Cell blocks
Each block starts with a #P line: #P, a space, the x
coordinate, a space and the y coordinate, both whole numbers that may be negative.
They give the position of the block’s upper-left corner, “assuming that 0 0 is the
center of the current window to the Life universe”. So x grows to the right and y
downwards, as on the screen, and the block #P -1 -1 with three rows of
three cells has its middle cell at 0, 0.
The rows come after the #P line, one for each line, until the next
# line or the end of the file. There is no limit to the number of rows
in a block, and no limit to the number of blocks: the big patterns in the collection
are made of hundreds. A pattern made of parts far apart can use a block for each
part, so that the empty space between them is not in the file.
The description does not say what a program does with blocks that overlap. The explorer counts a cell that is alive in any block as alive, once.
Rows with no #P line before them are not in the description. The
explorer puts them in a block of its own with its corner at 0, 0 and says so.
Rows
A row is made of . (the cell is off) and * (the cell is
on), the first character being the block’s first column. A row must be between 1 and
80 characters wide. A row may stop after its last *, because the dots to
its right say nothing; so a row with no live cells is written as a single
.. A line of no characters is not a row: it is ignored, and does not
move the next row down.
| Character | Meaning |
|---|---|
. | A dead cell |
* | A live cell |
| anything else | Not allowed in a row. The explorer takes the line as damaged, shows it and treats the character as a dead cell. |
Limits
| What | Limit | Source |
|---|---|---|
| Description lines | 22 | The description. Three files have 22. |
Characters after #D | 78 | The description |
| Characters in a row | 1 to 80 | The description. The widest row in the 150 files is 76. |
| Rows in a block | none | The description |
| Blocks | none | The description. The largest pattern, LOGGROW.LIF, has 561. |
| Coordinates | whole numbers | No range is given. The explorer reads positions between −33,554,431 and 33,554,431 and notes any beyond. |
| Digits in a rule | 0 to 8; 9 not allowed | The description |
The explorer shows a limit that is broken as a note on the line and reads the file
anyway; a character in a row that is not . or *, or a
#P line without two numbers, makes it read the file as damaged.
A worked example
ACORN.LIF from the collection, 139 bytes, with every line ending written as
0D 0A:
00000000 23 4C 69 66 65 20 31 2E 30 35 0D 0A 23 44 20 41 #Life 1.05..#D A
00000010 63 6F 72 6E 0D 0A 23 44 20 54 68 65 20 6D 6F 73 corn..#D The mos
00000020 74 20 76 69 67 6F 72 6F 75 73 6C 79 20 67 72 6F t vigorously gro
00000030 77 69 6E 67 20 37 2D 63 65 6C 6C 0D 0A 23 44 20 wing 7-cell..#D
00000040 22 6D 65 74 68 75 73 65 6C 61 68 22 20 70 61 74 "methuselah" pat
00000050 74 65 72 6E 2E 20 20 53 65 65 20 61 6C 73 6F 20 tern. See also
00000060 52 41 42 42 49 54 53 2E 0D 0A 23 4E 0D 0A 23 50 RABBITS...#N..#P
00000070 20 2D 33 20 2D 31 0D 0A 2E 2A 0D 0A 2E 2E 2E 2A -3 -1...*.....*
00000080 0D 0A 2A 2A 2E 2E 2A 2A 2A 0D 0A ..**..***..
| Offset | Bytes | Line | Meaning |
|---|---|---|---|
| 0x00 | 12 | #Life 1.05 | Version line. |
| 0x0C | 10 | #D Acorn | Description line 1. |
| 0x16 | 39 | #D The most vigorously growing 7-cell | Description line 2. |
| 0x3D | 45 | #D "methuselah" pattern. See also RABBITS. | Description line 3. |
| 0x6A | 4 | #N | Normal rules, 23/3. |
| 0x6E | 10 | #P -3 -1 | A block whose upper-left corner is at x −3, y −1. |
| 0x78 | 4 | .* | Row y = −1: a cell at x = −2. |
| 0x7C | 6 | ...* | Row y = 0: a cell at x = 0. |
| 0x82 | 9 | **..*** | Row y = 1: cells at x = −3, −2, 1, 2 and 3. |
Seven cells alive, in a box from x −3 to 3 and y −1 to 1, 7 × 3 cells, a density of 33.3%. The origin, 0 0, is the cell in the middle row, fourth column. Drawn:
.*.....
...*...
**..***
What the files on disk show
The LIFEP collection (dated 1 October 1995; the README is dated 15 October) is 150
.LIF files, each present in five copies on this Mac. Every one starts
with #Life 1.05 and has #N; none has #R,
#C or #O. Together they hold 8,802 cell blocks. Every line ends
with 0D 0A, and every file ends with one. No file has a Ctrl-Z, a tab or a character
other than . and * in a row, or a row wider than 76 characters.
The explorer reads all 150 and finds no problems.
Not described
This is what the reference leaves out and what the viewer does not do.
- Reference: how a program combines blocks that overlap is not stated by the format’s description; the explorer’s “alive in any block” reading is an assumption.
- Reference: the
#Rrule line is described from the format’s text only. No file on the Mac has one, so the digit order and an empty list (#R /2) are unchecked on real files. - Reference:
#Cand#Oare not in the description; what programs do with them is unknown. Coordinate limits are not given. - Reference: versions other than 1.05 (
#Life 1.03and the like) are known only from the program’s history; their differences, if any, are not described. - Viewer: it draws only the first generation and does not run the rules.
#Rand#Nare shown as text, never applied. - Viewer: positions beyond ±33,554,431 are noted and the cells left out. A file over 32 MB is read only as far as that, and the rest is shown as bytes.
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
- Golly – free Game of Life program that opens Life 1.05 files (Windows, macOS, Linux)
- Life 1.06 – Alan Hensel’s MS-DOS program that came with the collection (MS-DOS)
- Xlife – Jon Bennett’s Life program for the X window system (Unix)
- WinLife – John Harper’s program (Windows 3.1)
- LifeLab – Andrew Trevorrow’s program (Mac OS)
Reference
- LifeWiki – the Game of Life wiki, which describes the pattern file formats