Caesar 25 variants new
by aninaslyan
JavaScript
function chipher(coded) {
let alphabet = "abcdefghijklmnopqrstuvwxyz";
let str = "";
for (let i=0; i<coded.length; i++) {
let index = alphabet.indexOf(coded[i]);
}
/*
if(newIndex > 25) {
newIndex -= 26;
}
if(str[i] === str[i].toUpperCase()) {
coded += alphabet[newIndex].toUpperCase();
} else {
coded += alphabet[newIndex];
}
if(str[i] === " ") {
coded = coded + alphabet[newIndex] + " ";
}
}
return coded;*/
}
//text = prompt("Input text");
chipher("dql");