make states numbers instead of booleans
This commit is contained in:
@@ -18,16 +18,16 @@ datablock fxDTSBrickData(LogicGate_8bitSubtractor_Data)
|
||||
|
||||
logicUpdate =
|
||||
"return function(gate) " @
|
||||
" local c = bool_to_int[Gate.getportstate(gate, 17)] " @
|
||||
" local c = Gate.getportstate(gate, 17) " @
|
||||
" local a = 0 " @
|
||||
" local b = 0 " @
|
||||
" for i = 1, 8 do " @
|
||||
" a = bool_to_int[Gate.getportstate(gate, i )] " @
|
||||
" b = bool_to_int[Gate.getportstate(gate, i+8)] " @
|
||||
" Gate.setportstate(gate, i+17, bit.bxor(bit.bxor(a, b), c) == 1) " @
|
||||
" a = Gate.getportstate(gate, i ) " @
|
||||
" b = Gate.getportstate(gate, i+8) " @
|
||||
" Gate.setportstate(gate, i+17, bit.bxor(bit.bxor(a, b), c)) " @
|
||||
" c = bit.bor(bit.bor(bit.band(bool_to_int[a == 0], b), bit.band(bool_to_int[a == 0], c)), bit.band(b, c)) " @
|
||||
" end " @
|
||||
" Gate.setportstate(gate, 26, c == 1) " @
|
||||
" Gate.setportstate(gate, 26, c) " @
|
||||
"end"
|
||||
;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user