I'm making a program that converts ascii characters 'a' through 'z' and 'A' through 'Z'. (only letters). for example, a+1 = b
a+2 = c
b+1 = c
A+1 = B
So the only thing I'm not sure how to do is mapping around. How can I make it so that when checklower/checkupper is true, to basically map around to the lower case letter (example, of z+2 = b).
The simplest way is probably to use the
%
modulus operator:You'll need a symmetrical line for capital letters (or just make the
'a'
a variable too).