I was looking through a few old programs I wrote, and I came across this Enigma cipher simulator. I was wondering if you could help me refactor the algorithm, as it doesn't seem to be the most efficient method.
What's more, I'd have to learn the Enigma algorithm to actually help you refactor the code, and I'm much too lazy for that too. (And probably many other people feel the same.)
You'd be better off asking "hey do you see anything obviously wrong in my code?".
Well I do: it's usingnamespace std; in a header.
Also, you could rewrite Enigma::plugboard() to use switch() instead of that if()-else-if() centipede (although this merely removes the noise from the code and makes it easier to read, so technically it doesn't improve the program).