Skip to content
Create a gist now

Instantly share code, notes, and snippets.

@jarnaldich /1.rkt secret forked from dvanhorn/1.rkt
Created Aug 28, 2011

#lang racket
(require srfi/13)
(define (translate s)
(let* ([a (char->integer #\a)]
[h (for/hash ([c (in-range 26)])
(values (integer->char (+ a c))
(integer->char (+ a (modulo (+ c 2) 26)))))])
(string-map (lambda (c) (hash-ref h c c)) s)))
(translate " 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.")
(translate "map")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.