diff options
author | Kyle <kyle.kylina@gmail.com> | 2012-09-01 18:53:31 -0700 |
---|---|---|
committer | Kyle <kyle.kylina@gmail.com> | 2012-09-01 18:53:31 -0700 |
commit | 6f1296198cc7aa0a159893429672e77c524ad8c2 (patch) | |
tree | 1b06873a584fb1250f91e4dad3e161d6dbe28ad2 | |
parent | dc3fc4deb5e6b4d68a10799fc623176f996bcc24 (diff) | |
download | mesecons-6f1296198cc7aa0a159893429672e77c524ad8c2.tar mesecons-6f1296198cc7aa0a159893429672e77c524ad8c2.tar.gz mesecons-6f1296198cc7aa0a159893429672e77c524ad8c2.tar.bz2 mesecons-6f1296198cc7aa0a159893429672e77c524ad8c2.tar.xz mesecons-6f1296198cc7aa0a159893429672e77c524ad8c2.zip |
simplified effector rules
-rw-r--r-- | mesecons_gates/init.lua | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/mesecons_gates/init.lua b/mesecons_gates/init.lua index 27719a4..fdb0dc1 100644 --- a/mesecons_gates/init.lua +++ b/mesecons_gates/init.lua @@ -1,20 +1,14 @@ gates = {"diode", "not", "nand", "and", "xor"} -out = {x=1, y=0, z=0} -inonerules = {{x=-1, y=0, z=0}} -intworules = {{x=0, y=0, z=1},{x=0, y=0, z=-1}} -onerules = inonerules -table.insert(onerules, out) -tworules = intworules -table.insert(tworules, out) -outrules = {} -outrules = table.insert(outrules, out) for g in ipairs(gates) do gate = gates[g] if g < 3 then - inrules = inonerules - rules = onerules + rules = { + {x=-1, y=0, z=0}, + } else - inrules = intworules - rules = tworules + rules = { + {x=0, y=0, z=1}, + {x=0, y=0, z=-1}, + } end for on=0,1 do if on == 1 then @@ -58,7 +52,7 @@ for g in ipairs(gates) do gate = gates[g] }) - mesecon:register_effector(nodename, nodename, inrules) + mesecon:register_effector(nodename, nodename, rules) end end |