6 kyu
Cryptography #1 - Viva Cesare
296 of 800Dentzil
Description:
Let’s get to know our hero: Agent #134 - Mr. Slayer.
He was sent by his CSV agency to Ancient Rome in order to resolve some important national issues. However, something incredible has happened - the enemies have taken Julius Caesar as a prisoner!!!
Caesar, not a simple man as you know, managed to send cryptic message with coordinates of his location hoping that somebody would break the code. Here our agent of the secret service comes to the stage.
But he needs your help!
Mission:
You have to implement the function “Encode” of CaesarCrypto class that codes or decodes text based on Caesar’s algorithm.
- the function receives 2 parameters: an original text of any length of type “string” and a number of type “int” that represents shifts;
- only letters in both cases must be encrypted;
- alphabet contains only letters in this range: a-zA-Z;
- by encryption the letter can change the case;
- shift could be either positive or negative (for left shift);
- If the input text is empty, null or includes only whitespaces, return an empty string.
Time's ticking away. The life of Caesar is on the chopping block! Go for it!
Fundamentals
Cryptography
Algorithms
Similar Kata:
Stats:
Created | Jun 26, 2016 |
Published | Jun 26, 2016 |
Warriors Trained | 2557 |
Total Skips | 229 |
Total Code Submissions | 17546 |
Total Times Completed | 800 |
C# Completions | 77 |
JavaScript Completions | 176 |
Python Completions | 296 |
Ruby Completions | 47 |
C++ Completions | 119 |
PHP Completions | 57 |
Java Completions | 101 |
Total Stars | 84 |
% of votes with a positive feedback rating | 84% of 214 |
Total "Very Satisfied" Votes | 162 |
Total "Somewhat Satisfied" Votes | 36 |
Total "Not Satisfied" Votes | 16 |