Hi all,
I am looking for a XOR function. I remember seeing one somewhere but the search won't let me search for XOR.
Thank you!
0
XOR Function
Started by TheHappyBukkit, Aug 28 2012 12:20 PM
4 replies to this topic
#1
Posted 28 August 2012 - 12:20 PM
#2
Posted 28 August 2012 - 12:38 PM
while true do if rs.getInput("right") and rs.getInput("left") then rs.setOutput("back" false) elseif rs.getInput("right") and not rs.getInput("left") then rs.setOutput("back", true") elseif not rs.getInput("right") and rs.getInput("left") then rs.setOutput("back", true") end end
That might work
#3
Posted 28 August 2012 - 09:32 PM
sjele, on 28 August 2012 - 12:38 PM, said:
while true do if rs.getInput("right") and rs.getInput("left") then rs.setOutput("back" false) elseif rs.getInput("right") and not rs.getInput("left") then rs.setOutput("back", true") elseif not rs.getInput("right") and rs.getInput("left") then rs.setOutput("back", true") end end
That might work
Thanks, but I was more looking for a function, like XOR(a, />. Do you know how to do that?
#4
Posted 28 August 2012 - 10:10 PM
bit.bxor(a, :D/>/>
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users