DEV Community

Brian Bethencourt for CodeNewbie

Posted on

Weekly Challenge #2 - Dot Dash Decode

Morse code is a method of transmitting text information as a series of on-off tones, lights, or pulses. It uses a standardized sequence of short and long elements to represent individual letters, numbers, and some punctuation.

This week's programming challenge is to build an app that can either encode text into Morse code or decode Morse code into text.

For this challenge, you must build an app that can take user input either through the spacebar on a keyboard or by clicking a mouse and convert it to Morse code. Alternatively, you could build an app that translates Morse code input into regular text. The app should be able to handle capital letters, numbers, and some punctuation.

Here's a hint! The typical way to program this app is to store the Morse code equivalents for each character in a dictionary or list. Then you'll need to write logic to convert the user's input into Morse code using those equivalents. For example, when the user enters a "T", the app would convert that to "- " representing the short and long Morse code tones for the letter T.

This is a great challenge for practicing your logic and dictionary skills in any programming language. Feel free to build the app using the language and tools of your choice. Share your GitHub repo or CodePen link in the comments below!

Good luck and happy coding!

Top comments (0)