// SuperEnigma.h // adds a plugboard to the Enigma cipher machine #ifndef SUPERENIGMA_CLASS #define SUPERENIGMA_CLASS #include "Pair.h" #include "Enigma.h" #include class SuperEnigma : public Enigma { std::vector plugboard; std::vector changes; public: // default constructor SuperEnigma(); // copy constructor SuperEnigma(const SuperEnigma &); // destructor ~SuperEnigma(); // assignment operator SuperEnigma & operator=(const SuperEnigma &); // reads plugboard pairs as integers // calls the reader from Pair // translates them to characters void readAndSetPlugboard(); // prints indices of letters in original // message that were changed by the plugboard void displayChanges(); // returns true if the character is in the // alphaIn part of the plugboard // changes holds the index of the message // where the character was found // if character not found in plugboard, // index can be ignored bool isAlphaIn(char, int &); // mirror of isAlphaIn() // returns true if the character is in the // alphaOut part of the plugboard // the integer holds the index where // the character was found // if character not found in plugboard, // index can be ignored bool isAlphaOut(char, int &); // prints all wheels, with deleted letters // prints plugboad pairs as characters // values for plugboard are from 13 to 38 // inputs of 13 20 18 30 27 36 // result in a->h f->r o->x void printAll(); // same as encipherSpin() in Enigma except with // plugboard added and checked before // enciphering first wheel void encipherSpin(Coder *); // deciphers with the wheels spinning (backwards) // same as decipherSpin() in Enigma except // includes plugboard after all wheels are processed void decipherSpin(Coder *); // same as in Enigma void encipher(); // same as in Enigma void decipher(); // takes deciphered message and finds/replaces // plugboard values void doPlugboardOut(); // takes enciphered message and finds/replaces // plugboard values void doPlugboardIn(); private: // YOU MAY PUT ANY PRIVATE FUNCTIONS HERE }; #endif // SUPERENIGMA_CLASS