ObfuscatedMorseCode
Translates messages into Morse Code and then obfuscates them following these rules:
Replace the number of consecutive dots with a number, and replace the number of consecutive dashes with the letter of the alphabet at that position. E.g. S = ... = 3, Q = --.- = b1a, F = ..-. = 2a1.
Morse Code Dictionary
International Morse Code
- A .-
- B -...
- C -.-.
- D -..
- E .
- F ..-.
- G --.
- H ....
- I ..
- J .---
- K -.-
- L .-..
- M --
- N -.
- O ---
- P .--.
- Q --.-
- R .-.
- S ...
- T -
- U ..-
- V ...-
- W .--
- X -..-
- Y -.--
- Z --..
- 0 -----
- 1 .----
- 2 ..---
- 3 ...--
- 4 ....-
- 5 .....
- 6 -....
- 7 --...
- 8 ---..
- 9 ----.
- Fullstop .-.-.-
- Comma --..--
Installation
Add this line to your application's Gemfile:
gem 'obfuscated_morse_code'
And then execute:
$ bundle
Or install it yourself as:
$ gem install obfuscated_morse_code
Usage
You can use this gem from your terminal by running:
obfuscate file_name.txt
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
License
The gem is available as open source under the terms of the MIT License.