Caesars Cipher: My code pass all the tests but doesn't validate on FCC
See original GitHub issueChallenge Caesars Cipher has an issue.
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36
.
The code pass all the tests but doesn’t validate on FCC editor. Why that?
My code:
let engine = (v) => {
let low = 'A'.charCodeAt();
let high = 'Z'.charCodeAt();
if (!!v.match(/[a-z]/i)) {
if (v.charCodeAt() - 13 < low) {
let code = (high - (low - (v.charCodeAt() - 13 + 1)));
return String.fromCharCode(code);
}
else {
return String.fromCharCode(v.charCodeAt() - 13);
}
}
else {
return v;
}
};
function rot13(str) { // LBH QVQ VG!
return '"' + str
.split('')
.map(engine)
.join('') + '"';
}
// Change the inputs below to test
rot13("SERR PBQR PNZC");
rot13("SERR CVMMN!");
rot13("SERR YBIR?");
rot13("GUR DHVPX OEBJA QBT WHZCRQ BIRE GUR YNML SBK.");
Issue Analytics
- State:
- Created 7 years ago
- Comments:23 (18 by maintainers)
Top Results From Across the Web
Caesar cipher code is not cleared by check50, cannot figure ...
I coded the assignment and followed the best that I could. I can pass all of the Check50 arguments except one! Help?? The...
Read more >Help us build Version 7.0 of the freeCodeCamp curriculum
Over the course of passing thousands of tests, you build up projects and your own understanding of coding fundamentals. There is no ......
Read more >Crack the Code! Make a Caesar Cipher - Scientific American
Extra: Try finding a third person who does not know what a Caesar cipher is. Can they crack your code if they “intercept”...
Read more >My review on freeCodeCamp's curriculum - DEV Community
You run test cases and if you pass them, you are allowed to continue to the next challenge. The best part of fCC...
Read more >Ticket: # 1282270 - Time Warner interrupts my service with ...
They tell me to turn the modem on and off it doesn't work. ... went into internet service and changed my password and...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yeah @eakl I got that too… I share your frustration. Anyhow to contributors please update the messages to not have the quotes.
as in:
for all the tests.
Nice catch @BKinahan , but that has raised two issues: