Skip to content

Instantly share code, notes, and snippets.

@isaacabraham
Last active Aug 29, 2015
Embed
What would you like to do?
let translateLetter (left : Rotor, middle : Rotor, right : Rotor, reflector : Reflector, plugboard : Plugboard) : char -> char =
substituteUsing plugboard
>> translateUsing right Forward
>> translateUsing middle Forward
>> translateUsing left Forward
>> reflectUsing reflector
>> translateUsing left Inverse
>> translateUsing middle Inverse
>> translateUsing right Inverse
>> substituteUsing plugboard
// translate the character 'a'.
let answer:char = 'a' |> translateLetter (rotor1, rotor2, rotor3, reflectorA, myPlugboard)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment