14 lines
324 B
Text
14 lines
324 B
Text
def (rot13 s)
|
|
(as string
|
|
(map rot13
|
|
(as list s)))
|
|
|
|
Alphabet <- "abcdefghijklmnopqrstuvwxyz"
|
|
def (rot13 c) :case (and string?.c len.c=1)
|
|
if ("a" <= c <= "z")
|
|
let idx (pos c Alphabet)
|
|
Alphabet (idx+13 % 26)
|
|
("A" <= c <= "Z")
|
|
(downcase.c -> rot13 -> upcase)
|
|
:else
|
|
c
|