5 kyu
Caesar Cipher Helper
1,456 of 5,195eugene-bulkin
Description:
Write a class that, when given a string, will return an uppercase string with each letter shifted forward in the alphabet by however many spots the cipher was initialized to.
For example:
var c = new CaesarCipher(5); // creates a CipherHelper with a shift of five
c.encode('Codewars'); // returns 'HTIJBFWX'
c.decode('BFKKQJX'); // returns 'WAFFLES'
If something in the string is not in the alphabet (e.g. punctuation, spaces), simply leave it as is.
The shift will always be in range of [1, 26]
.
Ciphers
Object-oriented Programming
Strings
Algorithms
Similar Kata:
Stats:
Created | Oct 27, 2013 |
Published | Oct 27, 2013 |
Warriors Trained | 12340 |
Total Skips | 2723 |
Total Code Submissions | 45255 |
Total Times Completed | 5195 |
JavaScript Completions | 1456 |
CoffeeScript Completions | 74 |
Python Completions | 2487 |
Ruby Completions | 434 |
PHP Completions | 763 |
Rust Completions | 77 |
Total Stars | 283 |
% of votes with a positive feedback rating | 92% of 666 |
Total "Very Satisfied" Votes | 565 |
Total "Somewhat Satisfied" Votes | 91 |
Total "Not Satisfied" Votes | 10 |
Total Rank Assessments | 10 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |