Caesars Cipher questions

Caesars Cipher questions
0

#1

I don’t know what is wrong with “?” and why it is mix up with “Y” in my code. Help me, please

function rot13(str) { // LBH QVQ VG!
  var ass;
  var stre = str.charCodeAt(0);
  var abr;
  var arra = [];
  var arraye;
  for (var i = 0; i < str.length; i++) {
  stre = str.charCodeAt(i);
    
  if (stre>= 78 && stre <= 90) {
    stre = stre-13;
    abr = String.fromCharCode(stre);
    arra.push(abr);
  }
  else if (stre >= 60 && stre <= 77) {
    stre+= 13;
    abr = String.fromCharCode(stre);
    arra.push(abr);
  }
  else if (stre < 65 || stre > 90) {
    stre = stre;
    abr = String.fromCharCode(stre);
    arra.push(abr);
  }
  arraye = arra.join('');
   
  
  
}
  return arraye;
}
// Change the inputs below to test
rot13("SERR YBIR?"); 

Caesars Cipher - other approaches?
#2

I got it.
stre >= 65 not 60


#3

FYI - I moved your question to a new topic, because your question was very specific to your solution and not of the solution of the OP of the original topic your replied to. It is always better to ask new questions about a different code set in a new topic. If you want to make comments or suggestions to the OP’s question, then definitely reply back to such a thread.