Skip to content

Latest commit

 

History

History
39 lines (30 loc) · 1.28 KB

README.md

File metadata and controls

39 lines (30 loc) · 1.28 KB

Morse-Code-Convertor

This is a simple repository that contains various ways of encoding to morse and decoding morse in C. The algorithms implemented are a Binary tree traverse and a 2-D array traverse to decode. In spirit, the key idea to encode has been inspired from an answer in stack exchange.

Installation

Simple clone the repository to your local machine. The repo contains compiled executables for x86 architecture, one may need to recompile the C files if any issues arise.

Usage

Basic Array algorithm

Run the below command once in directory:

./bin/convert 

This code outputs a decoded morse message and encoded ASCII msg hard coded in main.c

Binary Tree algorithm

Run the command below, this executable accepts parameters as shown:

./bin/convert "<Your ASCII(in CAPS) msg or Morse Code>"

Note : While passing Morse code as a parameter use space as a seperator also put a space at the end of the code. A reminder to pass the parameter in quotes.

Examples

For ASCII

./bin/convert "SHE SELLS SEA SHELLS"

For Morse

./bin/convert "... --- ... "

By default (No parameters passed) the binary outputs the decoded morse code below:

--. --- --- -.. ---- .--- --- -... ---- --. ..- -.-- ...