Quipex

Disk/mem/redworks/programs/circuits/XOR

Apr 23rd, 2012
329
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. --2
  2. --1
  3. --0
  4. input = {}
  5. output = {}
  6. extra = {}
  7. input[1] = "left"
  8. input[2] = "right"
  9. output[1] = "back"
  10.  
  11. -- XOR Gate
  12. -- Created by: Streetstar5 aka FuzzyPurp
  13.  
  14. local rRunning = true
  15. term.clear()
  16. term.setCursorPos(1,2)
  17. print("XOR Gate is now running.")
  18. print("Input(s): " .. input[1] .. ", " .. input[2] .. ".")
  19. print("Output(s): " .. output[1] .. ".")
  20. print("\nHold Control+T to terminate.")
  21.  
  22. while rRunning do
  23. sleep(0.1)
  24. if rs.getInput(input[1]) ~= redstone.getInput(input[2]) then
  25. rs.setOutput(output[1], true)
  26. else
  27. rs.setOutput(output[1], false)
  28. end
  29. end
Add Comment
Please, Sign In to add comment