-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathff-life.1
79 lines (73 loc) · 1.7 KB
/
ff-life.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
.Dd 2024-03-29
.Dt FF-LIFE 1
.Os farbfeld-utils
.Sh NAME
.Nm ff-life
.Nd farbfeld program that generates life-like cellular automata
.Sh SYNOPSIS
.Nm
<?rule?> <?steps?>
.Sh DESCRIPTION
.Nm
reads a
.Xr farbfeld 5
image from stdin, generates life-like cellular automata and writes the result to stdout.
.Pp
In case of an error
.Nm
writes a diagnostic message to stderr.
.Sh EXIT STATUS
.Bl -tag -width Ds
.It 0
Image processed successfully.
.It 1
An error occurred.
.El
.Sh OPTIONS
The program takes up to two arguments:
- rule to use, in BS notation (default is B3/S23 which is Game of Life)
- the number of steps (default 1)
Black cells are off, white cells are on, and transparent cells are permanently
off.
.Sh REFERENCES
https://en.wikipedia.org/wiki/Life-like_cellular_automaton
.br
https://www.jeremykun.com/2012/07/29/the-cellular-automaton-method-for-cave-generation/
.Sh PRACTICAL EXAMPLE
One example is cave generation, see the reference for some details about this.
Use
.Xr ff-gradient 1
with "n" mode for random data, then use
.Xr ff-poster 1
to change to 1-bit-per-level.
This looks like:
$ ff-gradient 800 800 n42 000000 FFFFFF | ff-poster 1 > life-data.ff
Now you can apply the cellular automata.
The buttons described may be like the following:
- Apply B678/S345678:
.Nm
B678/S345678 20
- Apply B5678/S5678:
.Nm
B5678/S5678 1
- Increase Resolution: ff-enlarge
Combining the above:
$
.Nm
B678/S345678 20 < life-data.ff |
.Nm
B5678/S5678 | ff-enlarge > output.ff
.Sh EXAMPLES
$
.Nm
B678/S345678 20 < data.ff > life.ff
.Sh SEE ALSO
.Xr ff-conaut 1 ,
.Xr ff-critter 1 ,
.Xr ff-elementary 1 ,
.Xr ff-probaut 1 ,
.Xr ff-gradient 1 ,
.Xr ff-poster 1 ,
.Xr ff-enlarge 1 ,
.Xr farbfeld 5 ,
.Xr farbfeld-utils 7