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:

CreatedJun 26, 2016
PublishedJun 26, 2016
Warriors Trained2557
Total Skips229
Total Code Submissions17546
Total Times Completed800
C# Completions77
JavaScript Completions176
Python Completions296
Ruby Completions47
C++ Completions119
PHP Completions57
Java Completions101
Total Stars84
% of votes with a positive feedback rating84% of 214
Total "Very Satisfied" Votes162
Total "Somewhat Satisfied" Votes36
Total "Not Satisfied" Votes16
Ad
Contributors
  • Dentzil Avatar
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • smile67 Avatar
  • user5036852 Avatar
  • asedov Avatar
  • Blind4Basics Avatar
  • hobovsky Avatar
  • Just4FunCoder Avatar
  • saudiGuy Avatar
Ad