Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- _G.script = [=[
- ++++++++++[>+++++++>++++++++++>+++>+<<<<-]
- >++.>+.+++++++..+++.>++.<<<<+++++++++++++++.
- >.+++.------.--------.>+.>.
- ]=]
- local endf = ''
- for i = 1, _G.script:len() do
- if _G.script:sub(i, i) == '+' then
- endf = endf..'a()\n'
- elseif _G.script:sub(i, i) == '-' then
- endf = endf..'b()\n'
- elseif _G.script:sub(i, i) == '>' then
- endf = endf..'c()\n'
- elseif _G.script:sub(i, i) == '<' then
- endf = endf..'d()\n'
- elseif _G.script:sub(i, i) == '.' then
- endf = endf..'f()\n'
- elseif _G.script:sub(i, i) == ',' then
- endf = endf..'e()\n'
- elseif _G.script:sub(i, i) == '[' then
- endf = endf..'while p[current] ~= 0 do\n'
- elseif _G.script:sub(i, i) == ']' then
- endf = endf..'end\n'
- end
- end
- loadstring([[local p = {0}
- local current = 1
- local j = ''
- local g = ''
- function newbyte()
- p[#p+1] = 0
- end
- function k()
- if j == nil then return else return j end
- end
- function a()
- p[current] = p[current] + 1
- end
- function b()
- p[current] = p[current] - 1
- end
- function c()
- if current == #p then
- newbyte()
- current = current + 1
- else
- current = current + 1
- end
- end
- function d()
- if current ~= 1 then
- current = current - 1
- else
- print('\nData pointer out of range.')
- j = nil
- end
- end
- function e()
- p[current] = string.byte(io.read(1))
- end
- function f()
- if j ~= nil then
- io.write(string.char(p[current]))
- end
- end
- ]]..endf..[[
- pcall(function()
- for i, v in pairs(p) do
- if i ~= current then
- if i ~= #p then
- j = j..v..', '
- else
- j = j..v
- end
- elseif i == current then
- if i ~= #p then
- j = j..'['..v..'], '
- else
- j = j..'['..v..']'
- end
- end
- end
- j = '\n'..j
- end)
- print(k())]])()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement