DEV Community

Brian Bethencourt for CodeNewbie

Posted on

2

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!

Image of Datadog

How to Diagram Your Cloud Architecture

Cloud architecture diagrams provide critical visibility into the resources in your environment and how they’re connected. In our latest eBook, AWS Solution Architects Jason Mimick and James Wenzel walk through best practices on how to build effective and professional diagrams.

Download the Free eBook

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more