RosettaCodeData/Task/Rot-13/Seed7/rot-13.seed7
2023-07-01 13:44:08 -04:00

17 lines
425 B
Text

$ include "seed7_05.s7i";
const proc: main is func
local
var char: ch is ' ';
begin
ch := getc(IN);
while not eof(IN) do
if (ch >= 'a' and ch <= 'm') or (ch >= 'A' and ch <= 'M') then
ch := chr(ord(ch) + 13);
elsif (ch >= 'n' and ch <= 'z') or (ch >= 'N' and ch <= 'Z') then
ch := chr(ord(ch) - 13);
end if;
write(ch);
ch := getc(IN);
end while;
end func;