1rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join((position | {' ': ' '})[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: func(rotor(plugboard(word, plugboard_position), rotor_position)), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: func(plugboard(rotor(word, {v:k for k, v in rotor_position.items()}), plugboard_position))
.........
----------------------------------------------------------------------
Ran 9 tests in 0.002s
OK
t | 1 | rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join((position | {' ': ' '})[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: rotor(plugboard(word, plugboard_position), rotor_position), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: plugboard(rotor(word, {v:k for k, v in rotor_position.items()}), plugboard_position) | t | 1 | rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join((position | {' ': ' '})[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: func(rotor(plugboard(word, plugboard_position), rotor_position)), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: func(plugboard(rotor(word, {v:k for k, v in rotor_position.items()}), plugboard_position)) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
t | 1 | rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join((position | {' ': ' '})[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: rotor(plugboard(word, plugboard_position), rotor_position), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: plugboard(rotor(word, {v:k for k, v in rotor_position.items()}), plugboard_position) | t | 1 | rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join((position | {' ': ' '})[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: rotor(plugboard(word, plugboard_position), rotor_position), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: plugboard(rotor(word, {v:k for k, v in rotor_position.items()}), plugboard_position) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
t | 1 | rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join(position[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: rotor(plugboard(word, plugboard_position), rotor_position), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: plugboard(rotor(word, {v:k for k, v in rotor_position.items()} + {' ': ' '}), plugboard_position) | t | 1 | rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join((position | {' ': ' '})[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: rotor(plugboard(word, plugboard_position), rotor_position), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: plugboard(rotor(word, {v:k for k, v in rotor_position.items()}), plugboard_position) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
t | 1 | rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join(position[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: rotor(plugboard(word, plugboard_position), rotor_position), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: plugboard(rotor(word, {v:k for k, v in rotor_position.items()}), plugboard_position) | t | 1 | rotor, plugboard, enigma_encrypt, enigma_decrypt = lambda word, position: ''.join(position[letter] for letter in word), lambda word, position: ''.join(dict([tuple(charset) for charset in position] + [tuple(charset)[::-1] for charset in position]).get(letter, letter) for letter in word), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: rotor(plugboard(word, plugboard_position), rotor_position), lambda plugboard_position=None, rotor_position=None: lambda func: lambda word: plugboard(rotor(word, {v:k for k, v in rotor_position.items()} + {' ': ' '}), plugboard_position) |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|