# HG changeset patch # User Brian Neal # Date 1341449561 18000 # Node ID 9e02d8696e67bd8e9643040a3ba67f99cb5d1040 # Parent 919b7a0d18027473f68d925c19eb0fc7cea1adf0 Added enigma_machine::step(). diff -r 919b7a0d1802 -r 9e02d8696e67 enigma/machine.h --- a/enigma/machine.h Mon Jul 02 19:23:49 2012 -0500 +++ b/enigma/machine.h Wed Jul 04 19:52:41 2012 -0500 @@ -104,6 +104,13 @@ return electric_signal(c - 'A') + 'A'; } + // this is like key_press(), but it works in signal numbers (0-25) instead of chars: + int step(int n) + { + step_rotors(); + return electric_signal(n); + } + // Process a buffer of text of length n, placing the result in an output buffer. void process_text(const char* input, char* output, std::size_t n) {