This is my code for challenge Ceaser Cipher. It works with the letter behind “N” but doesn’t work with the letter before “N”. Pls, explain to me why my code doesn’t work. The result is “FEEE CBDE CAMC”
If you want good help you need to paste your actual code in here, not give us a pic. To display your code in here you need to wrap it in triple back ticks. On a line by itself type three back ticks. Then on the first line below the three back ticks paste in your code. Then below your code on a new line type three more back ticks. The back tick on my keyboard is in the upper left just above the Tab key and below the Esc key.
I don’t understand what you mean. My idea is that: if you see a value contained in an array Str has a value equal to a value contained in the array alphabet. You will check the index of the value in the array alphabet, if it is greater than 13, that means if you add it to 13, the result is out of the array alphabet. Because of that, you need to subtract it to 13 to guarantee the result is in the range of the array alphabet. And as you see in my code, it can turn all letters behind “N” (index=13) into the letters that have index-13. But before “N”, it doesn’t work.
Can you explain your idea clearer ?