Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (letterInMessage != 0) {
- TurnOver(movingRotors[0], sizeOfAlphabet);
- if (numbersOfRotorsInMachine >= 3) {
- if (movingRotors[1].amountOfNotches > 0 && movingRotors[1].amountOfMoves > 1) {
- for (int x = 0; x < movingRotors[1].amountOfNotches; x++) {
- if (movingRotors[1].position + 1 <= sizeOfAlphabet) {
- if (movingRotors[1].notch[x] == (movingRotors[1].position + 1)) {
- TurnOver(movingRotors[2], sizeOfAlphabet);
- doubleStep = true;
- break;
- }
- else {
- if (movingRotors[1].notch[x] == (movingRotors[1].position + 1) % sizeOfAlphabet) {
- TurnOver(movingRotors[2], sizeOfAlphabet);
- doubleStep = true;
- break;
- }
- }
- }
- }
- if (numbersOfRotorsInMachine >= 2) {
- if(!doubleStep){
- if (movingRotors[0].amountOfNotches > 0 && movingRotors[0].amountOfMoves > 1) {
- for (int x = 0; x < movingRotors[0].amountOfNotches; x++) {
- if (movingRotors[0].notch[x] == movingRotors[0].position) {
- TurnOver(movingRotors[1], sizeOfAlphabet);
- break;
- }
- }
- }
- }
- else {
- TurnOver(movingRotors[1], sizeOfAlphabet);
- doubleStep = false;
- }
- }
- letterInMessage = ChangeInput(movingRotors,staticRotors, numbersOfRotorsInMachine, reflector[numberOfReflector], alphabet, sizeOfAlphabet, letterInMessage);
- printf("%i", letterInMessage);
- printf(" ");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement