
/* rot13.q: rot13 encoding in Q */

import dict;

def CHARS = strcat ["a".."z"], RCHARS = drop 13 CHARS ++ take 13 CHARS,
  ROT13 = dict $ zip (CHARS++toupper CHARS) (RCHARS++toupper RCHARS);

rot13 C:Char	= C where C:Char = ROT13!C;
		= C otherwise;
rot13 S:String	= map rot13 S;
