secret
Created

  • Download Gist
1.rkt
Racket
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#lang racket
(define str
"g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.")
 
(define (translate-char c)
(cond [(char-alphabetic? c)
(cond [(char=? #\z c) #\b]
[(char=? #\y c) #\a]
[else (integer->char (+ 2 (char->integer c)))])]
[else c]))
 
(define (translate-string s)
(apply string (map f (string->list s))))
 
(translate-string str)
(translate-string "map")

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.