Day 5 - Morse Code II

April 30-Day Coding Challenge

April 30d Coding Challenge > Morse Code I

Day 5 - Morse Code II

Morse code, named for Samuel F. B. Morse, is a method of transmitting text information as a series of clicks that can be directly understood by a skilled listener or observer without special equipment.

Write a program to convert a given morse code back to english text. Individual letters will be separated by spaces

Input: ... -.. . ... -.- .. .-.. .-.. ... Output: SDESKILLS

Javascript array for the codes.

var code = {
	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: '__..',  0: '_____', 1: '.____', 2: '..___', 3: '...__',
	4: '...._', 5: '.....', 6: '_....', 7: '__...', 8: '___..', 9: '____.'
};

To Discuss more and follow up, join us at SDE Skills Discord Server, use the #women-in-tech channel.

How to submit your code

  1. Head over to repl.it
  2. create an account / log in.
  3. Code your submission and share it with user @sdeskills
  4. e-mail your submission to [email protected]

Note: While there is no submission deadline per-se, we recommend you answer these questions as soon as they are posted.

Day 5 - Morse Code I

Want the questions emailed?