Advertisement
Guest User

asdas

a guest
Oct 31st, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. term.clear()
  2. array = {}
  3. array[1] = ""
  4. array[2] = ""
  5. array[3] = ""
  6. array[4] = ""
  7.  
  8. function inputIsCorrect()
  9. print("Code was correct..!")
  10. redstone.setOutput("back", true)
  11. sleep(3)
  12. for i = 1, 4 do
  13. array[i] = ""
  14. end
  15. end
  16.  
  17. print ("1 2 3\n4 5 6\n7 8 9\n OK CLEAR")
  18.  
  19.  
  20. while true do
  21. e, s, x, y = os.pullEvent("monitor_touch")
  22. if array[1] == "" then
  23. if x == 1 and y == 8 then
  24. array[1] = "1"
  25. end
  26. if x == 3 and y == 8 then
  27. array[1] = "2"
  28. end
  29. if x == 5 and y == 8 then
  30. array[1] = "3"
  31. end
  32. elseif array[2] == "" then
  33. if x == 1 and y == 8 then
  34. array[2] = "1"
  35. end
  36. if x == 3 and y == 8 then
  37. array[2] = "2"
  38. end
  39. if x == 5 and y == 8 then
  40. array[2] = "3"
  41. end
  42. elseif array[3] == "" then
  43. if x == 1 and y == 8 then
  44. array[3] = "1"
  45. end
  46. if x == 3 and y == 8 then
  47. array[3] = "2"
  48. end
  49. if x == 5 and y == 8 then
  50. array[3] = "3"
  51. end
  52. end
  53. if array[1] ~= "" and array[2] ~= "" and array[3] ~= "" then
  54. tg = table.concat(array)
  55. tg = tonumber(tg)
  56. if tg == 139 then
  57. inputIsCorrect()
  58. end
  59. end
  60. end
  61. --tg = table.concat(array)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement