make states numbers instead of booleans

This commit is contained in:
Redo0
2021-05-29 13:14:50 -05:00
parent b08c3cd0c4
commit 16c1a9f75f
309 changed files with 2819 additions and 2819 deletions

View File

@@ -18,8 +18,8 @@ datablock fxDTSBrickData(LogicGate_HalfAdder_Data)
logicUpdate =
"return function(gate) " @
" Gate.setportstate(gate, 3, bit.bxor(bool_to_int[Gate.getportstate(gate, 1)], bool_to_int[Gate.getportstate(gate, 2)]) == 1) " @
" Gate.setportstate(gate, 4, Gate.getportstate(gate, 1) and Gate.getportstate(gate, 2)) " @
" Gate.setportstate(gate, 3, bit.bxor(Gate.getportstate(gate, 1), Gate.getportstate(gate, 2)) == 1) " @
" Gate.setportstate(gate, 4, (Gate.getportstate(gate, 1) and Gate.getportstate(gate, 2)) and 1 or 0) " @
"end"
;