- 📖 About the Project
- 💻 Getting Started
- 👥 Authors
- 🔭 Future Features
- 🤝 Contributing
- ⭐️ Show your support
- 🙏 Acknowledgements
- ❓ FAQ
- 📝 License
Morse Code Decoder aims to decode messages written in Morse code. With the help of Ruby, we will create methods to decipher individual characters, entire words, and even the entire message hidden in those old bottles. The resulting strings will be presented in uppercase, making it easier to read the messages.
To successfully decode the Morse code messages, we will implement the following methods:
- This method takes a Morse code character as a string parameter.
- It returns the corresponding uppercase alphabetic character.
- Example:
decode_char(".-")returns "A".
- This method takes a Morse code word as a string parameter.
- It returns the string representation of the word, with each character separated by a single space.
- Example:
decode_word("-- -.--")returns "MY".
- This method takes a Morse code message as a string parameter.
- It returns the string representation of the entire message, with each word separated by three spaces.
- Example:
decode("-- -.-- -. .- -- .")returns "MY NAME".
Ruby
Ruby
- Decodes a morse character a word and a sentence
- Returns the decoded message in uppercase
- Returns the decoded message with spaces between words and characters
To get started with decoding Morse code messages, follow these steps:
Ensure you have the following installed:
- Ruby programming language
- IRB (Interactive Ruby)
-
Clone this repository to your local machine:
git clone https://github.com/mailsg/Morse-Code.git -
Open your terminal and navigate to the project directory:
cd Morse-Codeand install dependencies by runningbundle install -
Run IRB to access the Ruby interactive console:
irb -
To run the project, execute the following command
irbdecode_char(".-")decode_word("-- -.--")decode("-- -.-- -. .- -- .")decode(".- -... --- -..- ..-. ..- .-.. .-.. --- ..-. .-. ..- -... .. . ...") -
Now you can use the provided methods to decode Morse code messages. For example: decode_char(".-")
decode_word("-- -.--")
decode("-- -.-- -. .- -- .")
👤 Sandeep Ghosh
- GitHub: @mailsg
- LinkedIn: Sandeep Ghosh
👤 Phelelani Ndlovu
- GitHub: @techmoves
- LinkedIn: Phelelani Ndlovu
- Add support for numbers and punctuation marks
- Add support for international characters
- Add support for prosigns
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page.
If you like this project, please give it a star. Contact me on LinkedIn. It will be a pleasure to hear from you.
I would like to thank Microverse (microverse.org) for providing the resources and the knowledge to work on projects like this.
- How do I install Ruby?
You can download the latest version of Ruby from the official website: https://www.ruby-lang.org/en/downloads/
-Where can I learn the basics of Ruby?
Check out the Ruby documentation and tutorials at https://www.ruby-lang.org/en/documentation/ and https://www.ruby-lang.org/en/documentation/quickstart/
This project is MIT licensed.