Part of the curriculmn at Turing:
Shell repo for B1 exercise
On GitHub
fork
In Terminal
git clone <your forked repo>
cd morse_translator
Using this repo, build a well tested Ruby program that translates a message from English to Morse Code.
- Fork the repo above
- Clone your fork
- Push your solution to your fork
- Use Github's interface to create a pull request
Translate English to Morse Code
- lowercase letters
$ translator = Translate.new
=> #<Translate:0x007fa1ab98cac0>
$ translator.eng_to_morse("hello world")
=> "......-...-..--- .-----.-..-..-.."
Translate English to Morse Code
- case insensitive, with numbers
$ translator = Translate.new
=> #<Translate:0x007fa1ab98cac0>
$ translator.eng_to_morse("Hello World")
=> "......-...-..--- .-----.-..-..-.."
$ translator.eng_to_morse("There are 3 ships")
=> "-......-.. .-.-.. ...-- ..........--...."
Translate English to Morse Code
- from a file
# in input.txt
I am in a file
$ translator = Translate.new
=> #<Translate:0x007fa1ab98cac0>
$translator.from_file("input.txt")
=> ".. .--- ..-. .- ..-....-..."
Translate Morse Code to English
$ translator = Translate.new
=> #<Translate:0x007fa1ab98cac0>
$ translator.morse_to_eng(".... . .-.. .-.. --- .-- --- .-. .-.. -..")
=> "hello world"