|
-
Jan 19th, 2010, 03:51 PM
#1
[RESOLVED] Swap letters - sort of like a simple encryption
I was helping someone who wanted to replace capital letters in a string with their "opposites", eg Z to A, Y to B, X to C, etc. I came up with a way to do it by determining the Ascii value of the letters and using that value minus 64 as an index to get it's opposite via a hard-coded "ZYXW..." string. That works but I first tried to come up with a formula for converting the Ascii values of the letters (65 to 90) to their opposite, eg 90 to 65, 89 to 66, etc. but I was unsuccessful. Can anyone think of an algorithm for that that works?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|