function rot13(str) { // LBH QVQ VG!
//Do not transform any non-alphabetic character (i.e. spaces, punctuation), but do pass them on.
//str = the value of the letters are shifted by 13 places
var ourArray = [str];
var i = 0;
while(i < ourArray.length) {
console.log(ourArray[i]);
//I want to print each letter of the array, perhaps .splice
i++;
}
return str;
}
// Change the inputs below to test
rot13("SERR PBQR PNZC"); //should decode to FREE CODE CAMP
rot13("SERR CVMMN!"); // should decode to FREE PIZZA!
rot13("SERR YBIR?"); // should decode to FREE LOVE?
rot13("GUR DHVPX OEBJA SBK WHZCF BIRE GUR YNML QBT."); // should decode to THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG.
-
Notifications
You must be signed in to change notification settings - Fork 0
JavaScript Algorithms and Data Structures Projects: Caesars Cipher https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher
TurtleWolfe/JavaScript-Algorithms-and-Data-Structures-Projects-Caesars-Cipher
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
JavaScript Algorithms and Data Structures Projects: Caesars Cipher https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/javascript-algorithms-and-data-structures-projects/caesars-cipher
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published