Difference between revisions of "Plaintext"

From LifeWiki
Jump to navigation Jump to search
(Added a variants section)
m
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The '''plaintext''' file format is a recent ASCII file format that is similar to [[Life 1.05]] in that it stores patterns simply by representing dead and alive cells by different characters and "drawing" the pattern with those characters. The particulars of the plaintext file format described here are based on the format used by [[Edwin Martin]]'s [[Life|Game of Life]] program, which uses the .cells file extension.  
The '''plaintext''' [[File formats|file format]] is similar to [[Life 1.05]] in that it stores patterns simply by representing dead and alive cells by different characters and "drawing" the pattern with those characters. The particulars of the plaintext file format described here are based on the format used by Edwin Martin's [https://playgameoflife.com/ Game of Life program] , which uses the .cells file extension.  


==Description of format==
==Description of format==
Line 13: Line 13:
It seems as though the convention is to add one final "!" line with nothing else on it before the pattern itself, but this is optional.
It seems as though the convention is to add one final "!" line with nothing else on it before the pattern itself, but this is optional.


To store the pattern itself, a "." is used to represent a dead cell, while an "O" (capital o) is used to represent an alive cell. This choice of characters was derived from the visual format used on [[Stephen Silver]]'s [http://www.argentum.freeserve.co.uk/lex.htm Life Lexicon].
To store the pattern itself, a "." is used to represent a dead cell, while an "O" (capital o) is used to represent an alive cell. This choice of characters was derived from the visual format used on {{LinkLexicon|style=raw|filename=lex.htm|patternname=The Life Lexicon}} by [[Stephen Silver]].


Because this file format was created much more recently than other similar file formats (such as Life 1.05), there is no restriction on the number of characters per line.
Because this file format was created much more recently than other similar file formats (such as Life 1.05), there is no restriction on the number of characters per line.
== Variants ==
Trailing dead cells are sometimes omitted on a line, and lines containing only dead cells are sometimes left completely blank.
Some programs use "*" instead of "O" (only one case in the pattern collection).


==Examples==
==Examples==
Line 48: Line 43:
</code>
</code>


==External links==
==Issues==
*[http://www.bitstorm.org/gameoflife/lexicon/ John Conway's Game of Life] by Edwin Martin
Some variations of the plaintext format exists,<ref name="post95845" /> which were results of older manual encoding and should be corrected. For example, trailing dead cells are sometimes omitted on a line, and lines containing only dead cells are sometimes left completely blank. [https://conwaylife.com/patterns/3enginecordershipeater.cells Another example file] used "*" (as in [[Life 1.05]]) instead of "O" erroneously.
*{{LinkLexicon|style=raw|filename=lex.htm|patternname=The Life Lexicon}} by Stephen Silver
 
==See also==
* [[File formats]]
 
==References==
<references>
<ref name="post95845">{{LinkForumThread
|format = ref
|title  = Re: LifeWiki Trusted Account Request Thread - Post requests here
|p      = 95845
|author = HubTou
|date  = May 1, 2020
}}</ref>
</references>


[[Category:Everything else]][[Category:File formats]]
[[Category:Everything else]][[Category:File formats]]
__NOTOC__

Latest revision as of 22:44, 29 April 2022

The plaintext file format is similar to Life 1.05 in that it stores patterns simply by representing dead and alive cells by different characters and "drawing" the pattern with those characters. The particulars of the plaintext file format described here are based on the format used by Edwin Martin's Game of Life program , which uses the .cells file extension.

Description of format

The first line is a header line, which has the form

!Name: Something

where "Something" is the name of the pattern described by the file. This is followed by optional "!" lines that describe the pattern. For example:

!This is a really cool pattern.
!It was first discovered by Some Guy.

It seems as though the convention is to add one final "!" line with nothing else on it before the pattern itself, but this is optional.

To store the pattern itself, a "." is used to represent a dead cell, while an "O" (capital o) is used to represent an alive cell. This choice of characters was derived from the visual format used on The Life Lexicon by Stephen Silver.

Because this file format was created much more recently than other similar file formats (such as Life 1.05), there is no restriction on the number of characters per line.

Examples

The following is a glider in plaintext format:

!Name: Glider
!
.O.
..O
OOO

The following is the Gosper glider gun in plaintext format:

!Name: Gosper glider gun
!
........................O...........
......................O.O...........
............OO......OO............OO
...........O...O....OO............OO
OO........O.....O...OO..............
OO........O...O.OO....O.O...........
..........O.....O.......O...........
...........O...O....................
............OO......................

Issues

Some variations of the plaintext format exists,[1] which were results of older manual encoding and should be corrected. For example, trailing dead cells are sometimes omitted on a line, and lines containing only dead cells are sometimes left completely blank. Another example file used "*" (as in Life 1.05) instead of "O" erroneously.

See also

References

  1. HubTou (May 1, 2020). Re: LifeWiki Trusted Account Request Thread - Post requests here (discussion thread) at the ConwayLife.com forums