A translation from my Haskell version Enigma simulator.
One difference: the reflector is not generated randomly.
cargo run
enigma machine simulator
seed: 23
rotor position 1: 5
rotor position 2: 12
rotor position 3: 7
input text (q to quit): HELLOWORLD
cipher text: DTPZWBVADW
input text (q to quit): q