Advertisement
BobMe

number to letter again

Dec 11th, 2019
206
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. local k = "9 6 27 25 15 21 27 18 5 1 4 27 20 8 9 19 27 25 15 21 27 1 18 5 27 7 1 25"
  2. local j = ""
  3.  
  4. local alph = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"," "}
  5.  
  6. -- LOCAL K
  7. local tab = {}
  8. local savar = 0
  9. for i=1,#k do
  10. if string.sub(k,i,i) == " " and i == 1 then
  11. savar = i
  12. table.insert(tab,string.sub(k,1,i-1))
  13. elseif string.sub(k,i,i) == " " and i ~= 1 then
  14. table.insert(tab,string.sub(k,savar+1,i-1))
  15. savar = i
  16. elseif i == #k then
  17. table.insert(tab,string.sub(k,savar+1,i))
  18. end
  19. end
  20. local output = ""
  21. for i=1,#tab do
  22. local ll = tab[i]
  23. output = output..alph[tonumber(ll)]
  24. end
  25. print(output)
  26. --LOCAL J
  27. local output = ""
  28. for i=1,#j do
  29. local g = string.sub(j,i,i)
  30. for f=1,#alph do
  31. if alph[f] == g then
  32. output = output..f.." "
  33. break
  34. end
  35. end
  36. end
  37. print(output)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement