question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Caesars Cipher: My code pass all the tests but doesn't validate on FCC

See original GitHub issue

Challenge 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:closed
  • Created 7 years ago
  • Comments:23 (18 by maintainers)

github_iconTop GitHub Comments

4reactions
raisedadeadcommented, Jul 22, 2016

Yeah @eakl I got that too… I share your frustration. Anyhow to contributors please update the messages to not have the quotes.

as in:

image

for all the tests.

1reaction
Bounceycommented, Jul 22, 2016

Nice catch @BKinahan , but that has raised two issues:

  1. Unclear instructions for the result expected
  2. codeUri not extracting and running the updated code without a refresh
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found