6 kyu

Encrypt this!

2,482 of 23,554suic

Description:

Acknowledgments:

I thank yvonne-liu for the idea and for the example tests :)

Description:

Encrypt this!

You want to create secret messages which can be deciphered by the Decipher this! kata. Here are the conditions:

  1. Your message is a string containing space separated words.
  2. You need to encrypt each word in the message using the following rules:
    • The first letter must be converted to its ASCII code.
    • The second letter must be switched with the last letter
  3. Keepin' it simple: There are no special characters in the input.

Examples:

encryptThis "Hello" == "72olle"
encryptThis "good" == "103doo"
encryptThis "hello world" == "104olle 119drlo"
encrypt_this("Hello") == "72olle"
encrypt_this("good") == "103doo"
encrypt_this("hello world") == "104olle 119drlo"
encrypt_this("Hello") == "72olle"
encrypt_this("good") == "103doo"
encrypt_this("hello world") == "104olle 119drlo"
Kata.encryptThis("Hello") == "72olle"
Kata.encryptThis("good") == "103doo"
Kata.encryptThis("hello world") == "104olle 119drlo"
Encrypt.encryptThis("Hello") == "72olle"
Encrypt.encryptThis("good") == "103doo"
Encrypt.encryptThis("hello world") == "104olle 119drlo"
Kata.encryptThis("Hello") => "72olle"
Kata.encryptThis("good") => "103doo"
Kata.encryptThis("hello world") => "104olle 119drlo"
encryptThis("Hello") === "72olle"
encryptThis("good") === "103doo"
encryptThis("hello world") === "104olle 119drlo"
encryptThis("Hello") === "72olle"
encryptThis("good") === "103doo"
encryptThis("hello world") === "104olle 119drlo"
encrypt_this("Hello") == "72olle"
encrypt_this("good") == "103doo"
encrypt_this("hello world") == "104olle 119drlo"
encrypt_this("Hello") == "72olle"
encrypt_this("good") == "103doo"
encrypt_this("hello world") == "104olle 119drlo"
EncryptThis("Hello") == "72olle"
EncryptThis("good") == "103doo"
EncryptThis("hello world") == "104olle 119drlo"
Kata.EncryptThis("Hello") == "72olle"
Kata.EncryptThis("good") == "103doo"
Kata.EncryptThis("hello world") == "104olle 119drlo"
Kata.EncryptThis("Hello") = "72olle"
Kata.EncryptThis("good") = "103doo"
Kata.EncryptThis("hello world") = "104olle 119drlo"
(= (encrypt-this "Hello") "72olle")
(= (encrypt-this "good" ) "103doo")
(= (encrypt-this "hello world") "104olle 119drlo")
encrypt_this("Hello") == "72olle"
encrypt_this("good") == "103doo"
encrypt_this("hello world") == "104olle 119drlo"
solution.encrypt_this("Hello") == "72olle"
solution.encrypt_this("good") == "103doo"
solution.encrypt_this("hello world") == "104olle 119drlo"
encryptThis("Hello") === "72olle"
encryptThis("good") === "103doo"
encryptThis("hello world") === "104olle 119drlo"
Fundamentals
Strings
Regular Expressions
Arrays
Ciphers
Algorithms
Cryptography
Security

Similar Kata:

Stats:

CreatedDec 7, 2016
PublishedDec 7, 2016
Warriors Trained47281
Total Skips7215
Total Code Submissions98860
Total Times Completed23554
Haskell Completions271
Python Completions8004
Ruby Completions584
Groovy Completions66
Swift Completions450
C Completions255
Kotlin Completions795
Scala Completions211
Java Completions2482
JavaScript Completions6990
TypeScript Completions1039
CoffeeScript Completions16
Go Completions804
C# Completions1056
VB Completions25
Rust Completions428
Clojure Completions81
Lua Completions103
PHP Completions409
Total Stars881
% of votes with a positive feedback rating92% of 2563
Total "Very Satisfied" Votes2198
Total "Somewhat Satisfied" Votes327
Total "Not Satisfied" Votes38
Total Rank Assessments5
Average Assessed Rank
6 kyu
Highest Assessed Rank
5 kyu
Lowest Assessed Rank
7 kyu
Ad
Contributors
  • suic Avatar
  • anter69 Avatar
  • gttotev Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • thefern Avatar
  • JH108 Avatar
  • Voile Avatar
  • ZED.CWT Avatar
  • clcraig Avatar
  • user1799785 Avatar
  • FArekkusu Avatar
  • aradenac Avatar
  • hobovsky Avatar
  • xavierguihot Avatar
  • c0deMaster Avatar
  • KayleighWasTaken Avatar
  • saudiGuy Avatar
Ad