Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- pronounced ski-tah-lee just fyi
- function switchConvert(num)
- if num >= 0 and num < 10 then
- return num
- elseif num == 9 then
- return 'a'
- elseif num == 10 then
- return 'b'
- elseif num == 11 then
- return 'c'
- elseif num == 12 then
- return 'd'
- elseif num == 13 then
- return 'e'
- elseif num == 14 then
- return 'f'
- elseif num == 15 then
- return 'g'
- elseif num == 16 then
- return 'h'
- elseif num == 17 then
- return 'i'
- elseif num == 18 then
- return 'j'
- elseif num == 19 then
- return 'k'
- elseif num == 20 then
- return 'l'
- elseif num == 21 then
- return 'm'
- elseif num == 22 then
- return 'n'
- elseif num == 23 then
- return 'o'
- elseif num == 24 then
- return 'p'
- elseif num == 25 then
- return 'q'
- elseif num == 26 then
- return 'r'
- elseif num == 27 then
- return 's'
- elseif num == 28 then
- return 't'
- elseif num == 29 then
- return 'u'
- elseif num == 30 then
- return 'v'
- elseif num == 31 then
- return 'w'
- elseif num == 32 then
- return 'x'
- elseif num == 33 then
- return 'y'
- elseif num == 34 then
- return 'z'
- else
- return "-"
- end
- end
- function fill()
- local initial = math.random(34)
- local parsedInitial = switchConvert(initial)
- return parsedInitial
- end
- function wrap(parchment, sec)
- local point = 1
- local wrap = ""
- local stick = ""
- local parchLen = #parchment
- for point=1,parchLen do
- local nextLen = math.random(sec)
- stick = stick..nextLen
- for i=1, nextLen - 1 do
- wrap = wrap..scytale.fill()
- end
- wrap = wrap..string.sub(parchment, point, point)
- end
- return wrap, stick
- end
- function unwrap(parchment, stick)
- local unwrap = ""
- local wrappedLen = #parchment
- local point = 0
- local stickPoint = 1
- while true do
- stickCurrent = string.sub(stick, stickPoint, stickPoint)
- if point == wrappedLen then
- break
- end
- point = point + stickCurrent
- stickPoint = stickPoint + 1
- unwrap = unwrap..string.sub(parchment, point, point)
- end
- return unwrap
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement