#svl // // rot13 in SVL // Julian Squires / 2001 // // rot13 x // Adds 13 to lowercase and uppercase alphabetic characters, // modulo 26. // Takes: the string to encode. // Returns: the encoded string. global function rot13 x x = mput[x, islower x, char((int(x|islower x)-int("a")+13)%26+int("a"))]; x = mput[x, isupper x, char((int(x|isupper x)-int("A")+13)%26+int("A"))]; return x; endfunction // main x global function main x local a; a = fread[STDIN, '(c:*)']; write(rot13(a[1])); endfunction // EOF rot13.svl