There are many codes that exist, some are well known and
hard to decode, like Morse code, and some is relatively easy, like rot13. Rot
13 is to convert a character to another. For example, A can be converted to N.
The definition can be written in DrRocket below:
(define (rot13 c)
(cond
[(char<=? #\A c
#\M) (integer->char (+ 13 (char->integer c)))]
[(char<=? #\a c
#\m) (integer->char (+ 13 (char->integer c)))]
[(char<=? #\N c
#\Z) (integer->char (- (char->integer c) 13))]
[(char<=? #\n c
#\z) (integer->char (- (char->integer c) 13))]
[else c]))
Therefore, “I Love You!” can be translated into rot13
language "V Ybir Lbh!"
No comments:
Post a Comment