Skip to content

Twilight-Logic/Morse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Morse code encoder/decoder

This program designed to encode ASCII text to morse code and to decode morse code back into ASCII text. The program can decode a series of characters supplied on the command line or take input from a file. Morse can also save its output to a file.

All morse characters and words must be delimited and by default the '/' character is used to delimit letters and a SPACE to separate words. However, any custom characters can be used.

Morse will decode letters of the alphabet, numbers, punctuations and some prosigns.

The following commands are available:

-d
Decode the following morse sequence to text. A sequence of morse code characters consisting of dots (dits) '.' and dashes '-' (dahs) must be supplied. Each letter and word must be separated by a delimeter. The default delimeters are '/' for letter and a space for each word. Custom characters can be specified using the -s command.
-e
Encode the following sequence of ASCII text into Morse code. A sequence of characters must be supplied. Longer sequences containing multiple words should be enclosed in double quotes.
-m
Encode the specified file containing ASCII text into Morse code. A name of a file containing a sequence of ASCII characters must be supplied.
-o
Specify a file for output. Instead of sending output to STDIO, it will be stored in the specified file.
-s
Specify separator characters. Two separator characters must be supplied. If using a space, the characters must be enclosed in double quotes.
-t
Decode the specified file containing morse code into ASCII text. A name of a file containing Morse code needs to be supplied. The file must contain Morse code characters consisting of dots (dits) '.' and dashes '-' (dahs). Each letter and word must be separated by a delimeter. The default delimeters are '/' for letter and a space for each word group. Custom characters can be specified using the -s command.

The source file can be compiled by simply running 'make' in the source directory.

Examples:

morse -e "This is morse!"

morse -d "-/..../../... ../... --/---/.-./..././-.-.--"

morse -s " /" -d"- .... .. .../.. .../-- --- .-. ... . -.-.--"

morse -m example.txt -o /encoded.morse

morse -t example.morse -o /decoded.txt

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published