:py:mod:`enigma.enigma` ======================= .. py:module:: enigma.enigma .. autoapi-nested-parse:: An Enigma machine. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: enigma.enigma.Enigma enigma.enigma.Rotor Attributes ~~~~~~~~~~ .. autoapisummary:: enigma.enigma.ROTOR_LEN .. py:data:: ROTOR_LEN .. py:class:: Enigma An Enigma machine. .. py:method:: press_key(self, letter_input) Press a key on the machine. :param letter_input: the key pressed :type letter_input: str :return: the letter bulb that lights up :rtype: str .. py:method:: step_rotors(self) Step rotors forward. Step first rotor, turning over rotors 2 and 3 if required. .. py:class:: Rotor(wiring, turnover_notch_letter) A single rotor for scrambling an input pin to a different output. .. py:method:: wire_up(self, output_letter_order) Wire up the rotor. Create a dict to implement the input/output wiring of the rotor pins. For example: "0": "7", "1": "17", "2": "2" :param output_letter_order: order of the 26 output pins :type output_letter_order: str .. py:method:: step(self) Advance the rotor by one. .. py:method:: trace(self, input_pin_pos0) Trace an input pin through the rotor to an output pin. :param input_pin_pos0: input pin from the previous component (machine or previous rotor) relative to position 0 of the rotor :type input_pin_pos0: int :return: output pin relative to position 0 of rotor :rtype: int