RosettaCodeData/Task/Rot-13/Pluto/rot-13.pluto
2025-08-11 18:05:26 -07:00

14 lines
400 B
Text

local function rot13(s)
local bytes = {s:byte(1, #s)}
for i = 1, #bytes do
local c = bytes[i]
if (c >= 65 and c <= 77) or (c >= 97 and c <= 109) then
bytes[i] = c + 13
elseif (c >= 78 and c <= 90) or (c >= 110 and c <= 122) then
bytes[i] = c - 13
end
end
return string.char(bytes:unpack())
end
print(rot13("nowhere ABJURER"))