RosettaCodeData/Task/Rot-13/EasyLang/rot-13.easy

16 lines
316 B
Text
Raw Permalink Normal View History

2023-09-16 17:28:03 -07:00
func$ rot13 str$ .
for c$ in strchars str$
2023-12-16 21:33:55 -08:00
c = strcode c$
if c >= 65 and c <= 90
c = (c + 13 - 65) mod 26 + 65
elif c >= 97 and c <= 122
c = (c + 13 - 97) mod 26 + 97
2023-07-01 11:58:00 -04:00
.
2023-12-16 21:33:55 -08:00
enc$ &= strchar c
2023-07-01 11:58:00 -04:00
.
2023-12-16 21:33:55 -08:00
return enc$
2023-07-01 11:58:00 -04:00
.
2023-12-16 21:33:55 -08:00
enc$ = rot13 "Rosetta Code"
print enc$
print rot13 enc$