Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- term.clear()
- array = {}
- array[1] = ""
- array[2] = ""
- array[3] = ""
- array[4] = ""
- function inputIsCorrect()
- print("Code was correct..!")
- redstone.setOutput("back", true)
- sleep(3)
- for i = 1, 4 do
- array[i] = ""
- end
- end
- print ("1 2 3\n4 5 6\n7 8 9\n OK CLEAR")
- while true do
- e, s, x, y = os.pullEvent("monitor_touch")
- if array[1] == "" then
- if x == 1 and y == 8 then
- array[1] = "1"
- end
- if x == 3 and y == 8 then
- array[1] = "2"
- end
- if x == 5 and y == 8 then
- array[1] = "3"
- end
- elseif array[2] == "" then
- if x == 1 and y == 8 then
- array[2] = "1"
- end
- if x == 3 and y == 8 then
- array[2] = "2"
- end
- if x == 5 and y == 8 then
- array[2] = "3"
- end
- elseif array[3] == "" then
- if x == 1 and y == 8 then
- array[3] = "1"
- end
- if x == 3 and y == 8 then
- array[3] = "2"
- end
- if x == 5 and y == 8 then
- array[3] = "3"
- end
- end
- if array[1] ~= "" and array[2] ~= "" and array[3] ~= "" then
- tg = table.concat(array)
- tg = tonumber(tg)
- if tg == 139 then
- inputIsCorrect()
- end
- end
- end
- --tg = table.concat(array)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement