Advertisement
RiseAboveHate

test table

Nov 18th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.48 KB | None | 0 0
  1. term.clear()
  2. term.setCursorPos(1, 1)
  3.  
  4. local Table = {"175", "217", "218", "219", "220"}
  5.  
  6. print("Please enter: '175' | '217' | '218' | '219' | '220'.\n")
  7. write("")
  8. local sCode = read()
  9. print("You entered: "..sCode.."\n")
  10.  
  11. local function SirensACode(tTable, tText)
  12.     local resault = "(Not found!)"
  13.     for i=1, #tTable do
  14.         if tText == tTable[i] then
  15.             resault = tTable[i]
  16.         end
  17.     end
  18.     return resault
  19. end
  20.  
  21. for i=1, #Table do
  22.     print("sCode = "..SirensACode(Table, sCode))
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement