One of the simplest and most widely known <dfn>ciphers</dfn> is a <code>Caesar cipher</code>, also known as a <code>shift cipher</code>. In a <code>shift cipher</code> the meanings of the letters are shifted by some set amount.
A common modern use is the <ahref="https://en.wikipedia.org/wiki/ROT13"target='_blank'>ROT13</a> cipher, where the values of the letters are shifted by 13 places. Thus 'A' ↔ 'N', 'B' ↔ 'O' and so on.
Write a function which takes a <ahref="https://en.wikipedia.org/wiki/ROT13"target='_blank'>ROT13</a> encoded string as input and returns a decoded string.
All letters will be uppercase. Do not transform any non-alphabetic character (i.e. spaces, punctuation), but do pass them on.
Remember to use <ahref='http://forum.freecodecamp.org/t/how-to-get-help-when-you-are-stuck/19514'target='_blank'>Read-Search-Ask</a> if you get stuck. Try to pair program. Write your own code.
- text: <code>rot13("SERR PBQR PNZC")</code> should decode to <code>FREE CODE CAMP</code>
testString: 'assert(rot13("SERR PBQR PNZC") === "FREE CODE CAMP", ''<code>rot13("SERR PBQR PNZC")</code> should decode to <code>FREE CODE CAMP</code>'');'
- text: <code>rot13("SERR CVMMN!")</code> should decode to <code>FREE PIZZA!</code>
testString: 'assert(rot13("SERR CVMMN!") === "FREE PIZZA!", ''<code>rot13("SERR CVMMN!")</code> should decode to <code>FREE PIZZA!</code>'');'
- text: <code>rot13("SERR YBIR?")</code> should decode to <code>FREE LOVE?</code>
testString: 'assert(rot13("SERR YBIR?") === "FREE LOVE?", ''<code>rot13("SERR YBIR?")</code> should decode to <code>FREE LOVE?</code>'');'
- text: <code>rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.")</code> should decode to <code>THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.</code>
testString: 'assert(rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.") === "THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.", ''<code>rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT.")</code> should decode to <code>THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.</code>'');'