Daily Challenge (245 Part Series)
Using the power of programming, we've translated Pig Latin and told humans the time. Now for this challenge, you have to write a simple Morse code decoder. Today's challenge comes from user jolaf on CodeWars
Your task is to implement a function that would take the Morse code as input and return a decoded human-readable string.
decodeMorse('.... . -.-- .--- ..- -.. .')
MorseCode.Get(".--") (returns string)
MorseCodes.get : Dict String String
morseCodes ! ".--" (Codes are in a Map String String)
MorseCode[".--"] ?: "" or MorseCode.getOrDefault(".--", "")
NOTE: For coding purposes, you should use ASCII characters
-, not Unicode characters.
I always thought it would be really cool to make a full-size Morse code decoder, taking audio as input and reading aloud the output. Perhaps I could start building it as a side project - it would give me an excuse to buy another Raspberry Pi.
Good luck, happy coding!
Want to propose a challenge for a future post? Email email@example.com with your suggestions!
Claim your page on DEV before someone else does
Level up every day