Ad
  • Custom User Avatar

    I olso made one by myself and its work for me, try this:
    const TOT_MORSE_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", ".----":"1", "..---":"2", "...--":"3", "....-":"4", ".....":"5", "-....":"6", "--...":"7", "---..":"8", "----.":"9", "-----":"0", "|":" "
    };

  • Custom User Avatar

    You could put the sentence that it's failing on into an online Morse Code generator. It's what I did but the kata is broken for me (see my recent comment).

  • Custom User Avatar

    Also read the note again:

    NOTE: Extra spaces before or after the code have no meaning and should be ignored.

  • Custom User Avatar

    Coffeescript/C++/Go/JavaScript/Julia/PHP/Python/Ruby/TypeScript: MORSE_CODE['.--']

    ???