Last active
August 29, 2015 14:16
-
-
Save mattbaker/f028895ac4b05e0cec23 to your computer and use it in GitHub Desktop.
Enigma racket encoding for @ltw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define (encode reflector rotor-l rotor-m rotor-r letter) | |
(list-ref alphabet | |
(rotor-translate-right (rotate rotor-r 1) | |
(rotor-translate-right rotor-m | |
(rotor-translate-right rotor-l | |
(reflect reflector | |
(rotor-translate-left rotor-l | |
(rotor-translate-left rotor-m | |
(rotor-translate-left (rotate rotor-r 1) | |
(letter-to-index letter)))))))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment