Closed BCParanormal closed 8 years ago
You're adding double quotes and a space around the output. The double quotes are simply there to signify the input and output are a string. They should not be in your output. In the future please visit the Help Chat to confirm what you're seeing is a bug and not an issue with your solution. Thanks and happy coding!
Yes I only did that because my original code without the double quotes would not pass, the problem still stands- I get the proper result but it will not pass me
The code you posted (minus the extra quotes) is still incorrect. The second test expects the result
to be FREE PIZZA!"
but your code outputs "FREE PI@@A!"
.
Hint: One of the numbers in your code is off by one.
Thanks I can get the code to output Free Pizza! by changing the 2nd else if to >= 77 so i get the right answer now but still won't pass
`function rot13(str) { // LBH QVQ VG! var result = ' ';
for(i = 0; i < str.length; i++){
if(str.charCodeAt(i) == 32){result += ' ';}
else if (str.charCodeAt(i) < 65 || str.charCodeAt(i) > 90){result += str.charAt(i);}
else if (str.charCodeAt(i) < 78){result += String.fromCharCode(str.charCodeAt(i) + 13);}
else{result += String.fromCharCode(str.charCodeAt(i) - 13);}
}
return result; }
// Change the inputs below to test rot13("GUR DHVPX OEBJA QBT WHZCRQ BIRE GUR YNML SBK."); `
Ok this code passes all tests manually, editor still won't pass it
Remove the space here: var result = ' ';
Yes already figured that out. Such a simple mistake . Thank you so much for putting up with this cranky old man
Challenge Caesars Cipher has an issue. User Agent is:
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36
. Please describe how to reproduce this issue, and include links to screenshots if possible.My code: