RosettaCodeData/Task/Rot-13/Insitux/rot-13.insitux
2023-10-02 18:11:16 -07:00

12 lines
340 B
Text

(function ROT-13-char ch
(let x (char-code ch)
x- (or (< 109 x 123) (< 77 x 91)))
(if (or (< 96 x 123) (< 64 x 91))
(char-code ((x- - +) x 13))
ch))
(function ROT-13 text
(.. str (map ROT-13-char text)))
(ROT-13 "The Quick Brown Fox Jumps Over The Lazy Dog!")
;returns "Gur Dhvpx Oebja Sbk Whzcf Bire Gur Ynml Qbt!"