summaryrefslogtreecommitdiff
path: root/module/tex/context/third/simpleslides/automata/automata-eca.lua
diff options
context:
space:
mode:
Diffstat (limited to 'module/tex/context/third/simpleslides/automata/automata-eca.lua')
-rw-r--r--module/tex/context/third/simpleslides/automata/automata-eca.lua10
1 files changed, 7 insertions, 3 deletions
diff --git a/module/tex/context/third/simpleslides/automata/automata-eca.lua b/module/tex/context/third/simpleslides/automata/automata-eca.lua
index 95d1f71..27450ba 100644
--- a/module/tex/context/third/simpleslides/automata/automata-eca.lua
+++ b/module/tex/context/third/simpleslides/automata/automata-eca.lua
@@ -10,7 +10,11 @@
--------------------------------------------------------------------------------
--
-environment.loadluafile( "automata-life" )
+if context then
+ environment.loadluafile( "automata-life" )
+else
+ require "automata-life"
+end
local help = gol.helpers
@@ -82,11 +86,11 @@ function eca.gen_frame(from, lines, rule)
local cnt = 1
local c = mplife.setup.current
- local new = { [1] = eca.stripcells(from, c.clip, c.diff ) }
+ local new = { [1] = eca.stripcells(from, c.clip, c.diff or 0 ) }
repeat
from = eca.next_line(from, rule)
- table.insert( new, eca.stripcells(from, c.clip, c.diff) )
+ table.insert( new, eca.stripcells(from, c.clip, c.diff or 0) )
cnt = cnt + 1
until cnt == lines
return eca.next_line(from, rule), new