Skip to content

rrrr #7672

Closed
gabygoole opened this Issue · 0 comments

2 participants

@gabygoole

Challenge Caesars Cipher has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

function rot13(str) { // LBH QVQ VG!
  var resStr = "";
  var tmp;
  for(var i = 0; i < str.length; i++) {
    tmp = str.charCodeAt(i);
    if (tmp >= 65 && tmp <= 90) {
       if(tmp <= 77) {
         resStr += String.fromCharCode(tmp + 13);
       } else {
         resStr += String.fromCharCode(tmp - 13);
       }
    } else {
      resStr += str.charAt(i);
    }
  }
  return resStr;
}

// Change the inputs below to test

rot13("SERR YBIR?");
@ltegman ltegman closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.