Replacing letters in a string(A with Z; B with Y; C with X; D with W; etc)

Hi !

Im trying to create a program that will replace letters in a string(A with Z; B with Y; C with X; D with W; etc).

So if i input:

CAR -> XZI

But the problem is it should only modify a letter once.
For example, if I input
Revolution, it would give me -> IVVLLGRLM (not correctly replaced) because it would replace the same letter twice.

How can i do this?
closed account (48T7M4Gy)
One way of performing this sort of encryption is to use multiple alphabets (with their substitutions) and changing the alphabet as encryption proceeds. E.g. two alphabets - one for odd characters and one for even characters. Or, have a once only alphabet for each character - I wish you luck keeping track of that with a simple program.
Can you post your code?
It seems like you are replaceing one letter at a time (all A to Z, then all B to Y, etc.). Try to replace one character at a time: look at first character, replace it, look at second, replace it.
Topic archived. No new replies allowed.