Inspiration
Morse Code Translator is a translator that lets anyone translate text to Morse code and decode Morse code to text easily. With the online Morse code translator, anyone can convert any plain text in English or whatever language to Morse code and vice versa.
What it does
The algorithm is very simple. Every character in the English language is substituted by a series of ‘dots’ and ‘dashes’ or sometimes just singular ‘dot’ or ‘dash’ and vice versa.
How we built it
In the case of encryption, we extract each character (if not space) from a word one at a time and match it with its corresponding morse code stored in whichever data structure we have chosen(if you are coding in python, dictionaries can turn out to be very useful in this case) and In the case of decryption, we start by adding a space at the end of the string to be decoded Here is a Program I have done using Python in order to translate Morse Code given Below......
Python program to implement Morse Code Translator
Dictionary representing the morse code chart
MORSE_CODE_DICT = { 'A':'.-', 'B':'-...', 'C':'-.-.', 'D':'-..', 'E':'.', 'F':'..-.', 'G':'--.', 'H':'....', 'I':'..', 'J':'.---', 'K':'-.-', 'L':'.-..', 'M':'--', 'N':'-.', 'O':'---', 'P':'.--.', 'Q':'--.-', 'R':'.-.', 'S':'...', 'T':'-', 'U':'..-', 'V':'...-', 'W':'.--', 'X':'-..-', 'Y':'-.--', 'Z':'--..', '1':'.----', '2':'..---', '3':'...--', '4':'....-', '5':'.....', '6':'-....', '7':'--...', '8':'---..', '9':'----.', '0':'-----', ', ':'--..--', '.':'.-.-.-', '?':'..--..', '/':'-..-.', '-':'-....-', '(':'-.--.', ')':'-.--.-'}
def encrypt(message): cipher = '' for letter in message: if letter != ' ':
cipher += MORSE_CODE_DICT[letter] + ' '
else:
cipher += ' '
return cipher
def decrypt(message):
message += ' '
decipher = ''
citext = ''
for letter in message:
if (letter != ' '):
i = 0
citext += letter
else:
i += 1
if i == 2 :
decipher += ' '
else:
decipher += list(MORSE_CODE_DICT.keys())[list(MORSE_CODE_DICT
.values()).index(citext)]
citext = ''
return decipher
def main(): message = "SUVAM SANKAR KAR" result = encrypt(message.upper()) print (result)
message = "... ..- ...- .- -- ... .- -. -.- .- .-. -.- .- .-."
result = decrypt(message)
print (result)
if name == 'main': main()
Challenges we ran into
1.Time consuming 2.You have to learn the morse code 3.It’s slow 4.Very easy to intercept.
Accomplishments that we're proud of
Learning how to translate Morse Code using Python........

Log in or sign up for Devpost to join the conversation.