I have to create a cipher program that shifts the letters of a message up and down according to a key. After thinking awhile I figured I would read in each character from a string, convert it to its numerical value (a=1, b=2) add the shift amount and turn back into a character to be printed out.
I know how to handle if I try to shift 3 past z(wrap around) I just didn’t know how to do the actual conversion. I can also handle it if it turns out ‘a’ is 37, just takes adjusting numbers.
Any idea on the actual syntax? Been tearing apart API’s and the Internets.
To convert a character you can do this