Mercurial > public > cpp-enigma
diff enigma/machine.h @ 15:9e02d8696e67
Added enigma_machine::step().
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 04 Jul 2012 19:52:41 -0500 |
parents | 919b7a0d1802 |
children | 280facb82b80 |
line wrap: on
line diff
--- 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) {