|
EnigmaMachineCore 0.1.0
A modular Enigma Machine simulation in C++20
|
Accepted
The internal signal path of the Enigma Machine involves passing a character through multiple rotors and a reflector. There are two primary ways to represent this signal:
char values (e.g., 'A', 'B') and performing character arithmetic.AlphabetIndex values representing the index in the alphabet (e.g., 0 to TRANSFORMER_SIZE - 1).We will use Alphabet Indices (AlphabetIndex values, 0 to TRANSFORMER_SIZE - 1) for all internal signal transformations within the Transformer, RotorBox, and PlugBoard classes.
TRANSFORMER_SIZE constant and updating the index range.EnigmaMachine::keyTransform (or a higher-level UI wrapper) is responsible for converting input char to int and back to char for the final output.int is used currently, future refactoring should consider strong typing (e.g., an AlphabetIndex class) to prevent accidental mixing of indices and raw values.