I'm trying to recreate the Enigma machine for a project for one of my classes. However, I'm having problems with the first step of the machine. I need to know how to swap letters in two strings. I'm starting with an alphabet string, eg. "ABCDEFGHIJKLMNOPQRSTUVWXYZ" and want to end up with:"ZPHNMSWCIYTQEDOBLRFKUVGXJA"
So 20 letters swap with each other, randomly, i.e A= Z, Z=A and 6 stay the same i.e. R=R … If that makes any sense.
I can get a random string of letters easily, but they won't be swapped in the way I want.