Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- B=string
- b=B.sub
- C=B.len
- function r(s, S)
- if s=="" then return S end
- S=S or ""
- return r(b(s,2),b(s,1,1)..S)
- end
- function p(s)
- for i=1,C(s) do
- if not(b(s,i,i) == " ") then W=W..b(s,i,i) else
- F=F..r(W).." "
- W=""
- end
- end
- F=F..r(W).." "
- end
- repeat
- F,W="",""
- print("String? (q=quit)")
- m=io.read()
- x=m=="q"and os.exit()
- p(m)
- print(F)
- until x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement