chunk
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat
keyword local
local
namelist
Name
write
optional namelist initialization
=
explist
exp
var
prefixexp
var
Name
io
.
Name
write
stat
varlist
var
Name
ALIVE
=
explist
exp
String
double quoted string
"¥"
stat
varlist
var
Name
DEAD
=
explist
exp
String
double quoted string
"þ"
stat
varlist
var
Name
ALIVE
=
explist
exp
String
double quoted string
"O"
stat
varlist
var
Name
DEAD
=
explist
exp
String
double quoted string
"-"
stat
keyword function
function
funcname
dotted name
Name
delay
optional colon name element
funcbody
(
optional parlist
)
block
chunk
stat list
stat
keyword for
for
Name
i
=
exp
Number
1
,
exp
Number
10000
keyword do
do
block
undef
keyword end
end
keyword end
end
stat
keyword function
function
funcname
dotted name
Name
ARRAY2D
optional colon name element
funcbody
(
optional parlist
namelist
Name
w
Name
h
)
block
chunk
stat list
stat list
stat
keyword local
local
namelist
Name
t
optional namelist initialization
=
explist
exp
tableconstructor
{
fieldlist
field
Name
w
=
exp
var
Name
w
field
Name
h
=
exp
var
Name
h
}
stat
keyword for
for
Name
y
=
exp
Number
1
,
exp
var
Name
h
keyword do
do
block
chunk
stat list
stat list
stat
varlist
var
prefixexp
var
Name
t
[
exp
var
Name
y
]
=
explist
exp
tableconstructor
{
}
stat
keyword for
for
Name
x
=
exp
Number
1
,
exp
var
Name
w
keyword do
do
block
chunk
stat list
stat
varlist
var
prefixexp
var
prefixexp
var
Name
t
[
exp
var
Name
y
]
[
exp
var
Name
x
]
=
explist
exp
Number
0
keyword end
end
keyword end
end
laststat
keyword return
return
optional explist
explist
exp
var
Name
t
keyword end
end
stat
varlist
var
Name
_CELLS
=
explist
exp
tableconstructor
{
}
stat
keyword function
function
funcname
dotted name
Name
_CELLS
optional colon name element
:
Name
spawn
funcbody
(
optional parlist
namelist
Name
shape
Name
left
Name
top
)
block
chunk
stat list
stat
keyword for
for
Name
y
=
exp
Number
0
,
exp
exp
var
prefixexp
var
Name
shape
.
Name
h
-
exp
Number
1
keyword do
do
block
chunk
stat list
stat
keyword for
for
Name
x
=
exp
Number
0
,
exp
exp
var
prefixexp
var
Name
shape
.
Name
w
-
exp
Number
1
keyword do
do
block
chunk
stat list
stat
varlist
var
prefixexp
var
prefixexp
var
Name
self
[
exp
exp
var
Name
top
+
exp
var
Name
y
]
[
exp
exp
var
Name
left
+
exp
var
Name
x
]
=
explist
exp
var
prefixexp
var
Name
shape
[
exp
exp
exp
exp
var
Name
y
*
exp
var
prefixexp
var
Name
shape
.
Name
w
+
exp
var
Name
x
+
exp
Number
1
]
keyword end
end
keyword end
end
keyword end
end
stat
keyword function
function
funcname
dotted name
Name
_CELLS
optional colon name element
:
Name
evolve
funcbody
(
optional parlist
namelist
Name
next
)
block
chunk
stat list
stat list
stat
keyword local
local
namelist
Name
ym1
Name
y
Name
yp1
Name
yi
optional namelist initialization
=
explist
exp
exp
var
prefixexp
var
Name
self
.
Name
h
-
exp
Number
1
exp
var
prefixexp
var
Name
self
.
Name
h
exp
Number
1
exp
var
prefixexp
var
Name
self
.
Name
h
stat
keyword while
while
exp
exp
var
Name
yi
>
exp
Number
0
keyword do
do
block
chunk
stat list
stat list
stat list
stat
keyword local
local
namelist
Name
xm1
Name
x
Name
xp1
Name
xi
optional namelist initialization
=
explist
exp
exp
var
prefixexp
var
Name
self
.
Name
w
-
exp
Number
1
exp
var
prefixexp
var
Name
self
.
Name
w
exp
Number
1
exp
var
prefixexp
var
Name
self
.
Name
w
stat
keyword while
while
exp
exp
var
Name
xi
>
exp
Number
0
keyword do
do
block
chunk
stat list
stat list
stat list
stat
keyword local
local
namelist
Name
sum
optional namelist initialization
=
explist
exp
exp
exp
exp
exp
exp
exp
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
ym1
]
[
exp
var
Name
xm1
]
+
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
ym1
]
[
exp
var
Name
x
]
+
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
ym1
]
[
exp
var
Name
xp1
]
+
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
y
]
[
exp
var
Name
xm1
]
+
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
y
]
[
exp
var
Name
xp1
]
+
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
yp1
]
[
exp
var
Name
xm1
]
+
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
yp1
]
[
exp
var
Name
x
]
+
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
yp1
]
[
exp
var
Name
xp1
]
stat
varlist
var
prefixexp
var
prefixexp
var
Name
next
[
exp
var
Name
y
]
[
exp
var
Name
x
]
=
explist
exp
exp
exp
(
exp
exp
(
exp
exp
var
Name
sum
==
exp
Number
2
)
keyword and
and
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
y
]
[
exp
var
Name
x
]
)
keyword or
or
exp
(
exp
exp
(
exp
exp
var
Name
sum
==
exp
Number
3
)
keyword and
and
exp
Number
1
)
keyword or
or
exp
Number
0
stat
varlist
var
Name
xm1
var
Name
x
var
Name
xp1
var
Name
xi
=
explist
exp
var
Name
x
exp
var
Name
xp1
exp
exp
var
Name
xp1
+
exp
Number
1
exp
exp
var
Name
xi
-
exp
Number
1
keyword end
end
stat
varlist
var
Name
ym1
var
Name
y
var
Name
yp1
var
Name
yi
=
explist
exp
var
Name
y
exp
var
Name
yp1
exp
exp
var
Name
yp1
+
exp
Number
1
exp
exp
var
Name
yi
-
exp
Number
1
keyword end
end
keyword end
end
stat
keyword function
function
funcname
dotted name
Name
_CELLS
optional colon name element
:
Name
draw
funcbody
(
optional parlist
)
block
chunk
stat list
stat list
stat list
stat
keyword local
local
namelist
Name
out
optional namelist initialization
=
explist
exp
String
double quoted string
""
stat
keyword for
for
Name
y
=
exp
Number
1
,
exp
var
prefixexp
var
Name
self
.
Name
h
keyword do
do
block
chunk
stat list
stat list
stat
keyword for
for
Name
x
=
exp
Number
1
,
exp
var
prefixexp
var
Name
self
.
Name
w
keyword do
do
block
chunk
stat list
stat
varlist
var
Name
out
=
explist
exp
exp
var
Name
out
..
exp
(
exp
exp
(
exp
exp
(
exp
exp
var
prefixexp
var
prefixexp
var
Name
self
[
exp
var
Name
y
]
[
exp
var
Name
x
]
>
exp
Number
0
)
keyword and
and
exp
var
Name
ALIVE
)
keyword or
or
exp
var
Name
DEAD
)
keyword end
end
stat
varlist
var
Name
out
=
explist
exp
exp
var
Name
out
..
exp
String
double quoted string
"\n"
keyword end
end
stat
functioncall
prefixexp
var
Name
write
args
(
optional explist
explist
exp
var
Name
out
)
keyword end
end
stat
keyword function
function
funcname
dotted name
Name
CELLS
optional colon name element
funcbody
(
optional parlist
namelist
Name
w
Name
h
)
block
chunk
stat list
stat list
stat list
stat list
stat
keyword local
local
namelist
Name
c
optional namelist initialization
=
explist
exp
exp
var
Name
ARRAY2D
args
(
optional explist
explist
exp
var
Name
w
exp
var
Name
h
)
stat
varlist
var
prefixexp
var
Name
c
.
Name
spawn
=
explist
exp
var
prefixexp
var
Name
_CELLS
.
Name
spawn
stat
varlist
var
prefixexp
var
Name
c
.
Name
evolve
=
explist
exp
var
prefixexp
var
Name
_CELLS
.
Name
evolve
stat
varlist
var
prefixexp
var
Name
c
.
Name
draw
=
explist
exp
var
prefixexp
var
Name
_CELLS
.
Name
draw
laststat
keyword return
return
optional explist
explist
exp
var
Name
c
keyword end
end
stat
varlist
var
Name
HEART
=
explist
exp
tableconstructor
{
fieldlist
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
1
field
exp
Number
1
field
Name
w
=
exp
Number
3
field
Name
h
=
exp
Number
3
}
stat
varlist
var
Name
GLIDER
=
explist
exp
tableconstructor
{
fieldlist
field
exp
Number
0
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
Name
w
=
exp
Number
3
field
Name
h
=
exp
Number
3
}
stat
varlist
var
Name
EXPLODE
=
explist
exp
tableconstructor
{
fieldlist
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
1
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
Name
w
=
exp
Number
3
field
Name
h
=
exp
Number
4
}
stat
varlist
var
Name
FISH
=
explist
exp
tableconstructor
{
fieldlist
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
1
field
exp
Number
1
field
exp
Number
1
field
exp
Number
0
field
exp
Number
0
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
exp
Number
0
field
exp
Number
0
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
0
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
Name
w
=
exp
Number
5
field
Name
h
=
exp
Number
4
}
stat
varlist
var
Name
BUTTERFLY
=
explist
exp
tableconstructor
{
fieldlist
field
exp
Number
1
field
exp
Number
0
field
exp
Number
0
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
exp
Number
0
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
0
field
exp
Number
1
field
exp
Number
1
field
exp
Number
0
field
exp
Number
0
field
exp
Number
0
field
exp
Number
1
field
Name
w
=
exp
Number
5
field
Name
h
=
exp
Number
5
}
stat
keyword function
function
funcname
dotted name
Name
LIFE
optional colon name element
funcbody
(
optional parlist
namelist
Name
w
Name
h
)
block
chunk
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat
keyword local
local
namelist
Name
thisgen
optional namelist initialization
=
explist
exp
exp
var
Name
CELLS
args
(
optional explist
explist
exp
var
Name
w
exp
var
Name
h
)
stat
keyword local
local
namelist
Name
nextgen
optional namelist initialization
=
explist
exp
exp
var
Name
CELLS
args
(
optional explist
explist
exp
var
Name
w
exp
var
Name
h
)
stat
functioncall
prefixexp
var
Name
thisgen
:
Name
spawn
args
(
optional explist
explist
exp
var
Name
GLIDER
exp
Number
5
exp
Number
4
)
stat
functioncall
prefixexp
var
Name
thisgen
:
Name
spawn
args
(
optional explist
explist
exp
var
Name
EXPLODE
exp
Number
25
exp
Number
10
)
stat
functioncall
prefixexp
var
Name
thisgen
:
Name
spawn
args
(
optional explist
explist
exp
var
Name
FISH
exp
Number
4
exp
Number
12
)
stat
keyword local
local
namelist
Name
gen
optional namelist initialization
=
explist
exp
Number
1
stat
functioncall
prefixexp
var
Name
write
args
(
optional explist
explist
exp
String
double quoted string
"\027[2J"
)
stat
keyword while
while
exp
Number
1
keyword do
do
block
chunk
stat list
stat list
stat list
stat list
stat list
stat list
stat list
stat
functioncall
prefixexp
var
Name
thisgen
:
Name
evolve
args
(
optional explist
explist
exp
var
Name
nextgen
)
stat
varlist
var
Name
thisgen
var
Name
nextgen
=
explist
exp
var
Name
nextgen
exp
var
Name
thisgen
stat
functioncall
prefixexp
var
Name
write
args
(
optional explist
explist
exp
String
double quoted string
"\027[H"
)
stat
functioncall
prefixexp
var
Name
thisgen
:
Name
draw
args
(
optional explist
)
stat
functioncall
prefixexp
var
Name
write
args
(
optional explist
explist
exp
String
double quoted string
"Life - generation "
exp
var
Name
gen
exp
String
double quoted string
"\n"
)
stat
varlist
var
Name
gen
=
explist
exp
exp
var
Name
gen
+
exp
Number
1
stat
keyword if
if
exp
exp
var
Name
gen
>
exp
Number
2000
keyword then
then
block
chunk
laststat
keyword break
break
elseif sequence
optional else block
keyword end
end
keyword end
end
keyword end
end
stat
functioncall
prefixexp
var
Name
LIFE
args
(
optional explist
explist
exp
Number
40
exp
Number
20
)
