5 kyu
Caesar Cipher Helper
1,441 of 5,147eugene-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 | 12212 |
Total Skips | 2710 |
Total Code Submissions | 45044 |
Total Times Completed | 5147 |
JavaScript Completions | 1441 |
CoffeeScript Completions | 73 |
Python Completions | 2463 |
Ruby Completions | 432 |
PHP Completions | 755 |
Rust Completions | 70 |
Total Stars | 281 |
% of votes with a positive feedback rating | 92% of 661 |
Total "Very Satisfied" Votes | 561 |
Total "Somewhat Satisfied" Votes | 90 |
Total "Not Satisfied" Votes | 10 |
Total Rank Assessments | 10 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 7 kyu |