Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. if (letterInMessage != 0) {
  2. TurnOver(movingRotors[0], sizeOfAlphabet);
  3. if (numbersOfRotorsInMachine >= 3) {
  4. if (movingRotors[1].amountOfNotches > 0 && movingRotors[1].amountOfMoves > 1) {
  5. for (int x = 0; x < movingRotors[1].amountOfNotches; x++) {
  6. if (movingRotors[1].position + 1 <= sizeOfAlphabet) {
  7. if (movingRotors[1].notch[x] == (movingRotors[1].position + 1)) {
  8. TurnOver(movingRotors[2], sizeOfAlphabet);
  9. doubleStep = true;
  10. break;
  11. }
  12. else {
  13. if (movingRotors[1].notch[x] == (movingRotors[1].position + 1) % sizeOfAlphabet) {
  14. TurnOver(movingRotors[2], sizeOfAlphabet);
  15. doubleStep = true;
  16. break;
  17. }
  18. }
  19. }
  20. }
  21. if (numbersOfRotorsInMachine >= 2) {
  22. if(!doubleStep){
  23. if (movingRotors[0].amountOfNotches > 0 && movingRotors[0].amountOfMoves > 1) {
  24. for (int x = 0; x < movingRotors[0].amountOfNotches; x++) {
  25. if (movingRotors[0].notch[x] == movingRotors[0].position) {
  26. TurnOver(movingRotors[1], sizeOfAlphabet);
  27. break;
  28. }
  29. }
  30. }
  31. }
  32. else {
  33. TurnOver(movingRotors[1], sizeOfAlphabet);
  34. doubleStep = false;
  35. }
  36. }
  37. letterInMessage = ChangeInput(movingRotors,staticRotors, numbersOfRotorsInMachine, reflector[numberOfReflector], alphabet, sizeOfAlphabet, letterInMessage);
  38. printf("%i", letterInMessage);
  39. printf(" ");
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement