I need help with homework from college, my teacher asked me a coder / decoder of enigma machine...
I declared the Rotors:
I also need to make the code read a text file and I make this function but don't know if it is rightCode:char rotortop[26] = {'B','D','F','H','J','I','N','P','R','T','V','X','Z','A','C','E','G','I','K','M','O','Q','S','U','W','Y'}; char rotormid[26] = {'E','J','O','T','Y','C','H','M','R','W','A','F','K','P','U','Z','D','I','N','S','X','B','G','L','Q','V'}; char rotorbot[26] = {'G','N','U','A','H','O','V','B','I','P','W','C','J','Q','X','D','K','R','Y','E','L','S','Z','F','M','T'};
Code:void descodificar(void){ printf("Entre com o texto que deseja descodificar: \n"); scanf("%c", &texto); FILE *file; file = fopen("TextoDescod2.txt", "w"); fprintf(file, "%c", texto); //Algoritmo Enigma fclose(file);}
Basically, after the rotor complete the circle, the next rotor should start spinning and I can not do this.
I don't know how to make this algorithm...
Sorry for bad english, i'm from brazil... the comments is in portuguese...
I appreciate the help.
I need help with homework from college, my teacher asked me a coder / decoder machine