Script
Script3y ago

Script – 16-19 Jan 27

I'm trying to do Caesar cipher I already wrote the logic to flip the alphabets, but now I'm not sure how to write my for loop to index the respective alphabets and get the encrypted text
function caesarCipher(s, k) {
let alphabets = "abcdefghijklmnopqrstuvwxyz";
let oA = alphabets.split("",k).join("")
let aa = alphabets.split("",26).reverse().join("")
aa = aa.split("",26-k).reverse().join("")
aa = aa.concat(oA)

for(i=0; i<= ; i++) {}

}
console.log(caesarCipher("middle-Outz", 3))
function caesarCipher(s, k) {
let alphabets = "abcdefghijklmnopqrstuvwxyz";
let oA = alphabets.split("",k).join("")
let aa = alphabets.split("",26).reverse().join("")
aa = aa.split("",26-k).reverse().join("")
aa = aa.concat(oA)

for(i=0; i<= ; i++) {}

}
console.log(caesarCipher("middle-Outz", 3))
1 Reply
reactibot
reactibot3y ago
This thread hasn’t had any activity in 12 hours, so it’s now locked. Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/936294346280546315 Question not getting answered? Maybe it's hard to answer, or maybe you asked at a slow time. Check out these resources for help asking a good question: https://stackoverflow.com/help/how-to-ask http://wp.me/p2oIwo-26