Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ .,!?-_"
- caps = "aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ"
- function getChID(abcc)
- return(string.find(chars, abcc))
- end
- function getCh(abci)
- return(string.sub(chars, abci, abci))
- end
- function getIDLim()
- return(#chars)
- end
- function allCaps(abct)
- abcto = ""
- for abci=1, #abct do
- abctemp = string.sub(abct, abci, abci)
- if string.find(caps, abctemp) then
- if string.find(caps, abctemp) % 2 == 1 then
- abctemp = caps[string.find(caps, abctemp)+1]
- end
- end
- abcto = abcto..abctemp
- end
- return(abcto)
- end
- function noCaps(abct)
- abcto = ""
- for abci=1, #abct do
- abctemp = string.sub(abct, abci, abci)
- if string.find(caps, abctemp) then
- if string.find(caps, abctemp) % 2 == 0 then
- abctemp = caps[string.find(caps, abctemp)-1]
- end
- end
- abcto = abcto..abctemp
- end
- return(abcto)
- end
- function abcOrder(abcoin)
- abcoout = {}
- abctemp = abcoin[1]
- if #abcoin == 1 then
- abcoout[1] = abctemp
- end
- for i=1, #abcoin-1 do
- looking = true
- j = 0
- while looking do
- j = j+1
- ex = false
- for k=1, #abcoout do
- if abctemp == abcoout[k] then
- ex = true
- end
- end
- if not ex then
- if not getChID(string.sub(abctemp, j, j)) == getChID(string.sub(abcoin[i], j, j)) then
- looking = false
- if getChID(string.sub(abctemp, j, j)) < getChID(string.sub(abcoin[i], j, j)) then
- abctemp = abcoin[i]
- end
- end
- end
- end
- table.insert(abcoout, abctemp)
- end
- return(abcoout)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement