Skip to content

jtrtj/morse_translator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Part of the curriculmn at Turing:

morse_translator

Shell repo for B1 exercise

On GitHub fork

In Terminal

git clone <your forked repo>
cd morse_translator

Morse Translator

Using this repo, build a well tested Ruby program that translates a message from English to Morse Code.

Submission instructions

  1. Fork the repo above
  2. Clone your fork
  3. Push your solution to your fork
  4. Use Github's interface to create a pull request

Iteration 0

Translate English to Morse Code

  • lowercase letters
  $ translator = Translate.new 
  => #<Translate:0x007fa1ab98cac0>
  $ translator.eng_to_morse("hello world") 
  => "......-...-..--- .-----.-..-..-.."

Iteration 1

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") 
  => "-......-.. .-.-.. ...-- ..........--...."

Iteration 2

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")
  => ".. .--- ..-. .- ..-....-..."

Iteration 3

Translate Morse Code to English

  $ translator = Translate.new 
  => #<Translate:0x007fa1ab98cac0>
  $ translator.morse_to_eng(".... . .-.. .-.. ---  .-- --- .-. .-.. -..") 
  => "hello world"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 100.0%