Back
Close

Ceaser Cipher

Adriaan
3,170 views
Previous: More Functions Next: More Soon

Now it's time to write a function that will encode a given String value using the caesar Cipher. The function should only needs to work with lowercase letters from a - z and a space character. So your alphabet will be: javascript const alphabet = "abcdefghijklmnopqrstuvwxyz ";

Hint: You can use the toLowerCase() method of the String type to transform your input string to lowercase characters.

The function needs to take 2 parameters. The first parameter should be of type String and hold the value of the phrase you want to encode. The second parameter should be of type Number and hold the value of the key.

Good Luck!

Caesar Cipher Enciding Function
// Write your encode function here.
// Please note the function name must be: encode
// { autofold
module.exports = encode;
// }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants