Talk:Morse code

Revision as of 15:05, 31 July 2012 by rosettacode>Gerard Schildberger (→‎international morse code characters: re-instated a @ instead of a period, added other names for a vergule.. -- ~~~~)

Dependence on the PC speaker

Some computers (including mine) don't have a configured/enabled PC speaker. Consider specifically allowing any sound output device instead. --Michael Mol 07:48, 24 August 2010 (UTC)

Multiple roles

This task covers at least three things:

  • File I/O
  • Encoding (characters to Morse)
    • Notably limited to Latin characters.
  • Sound output.

At the very least, I think these separate components should be specced in the task description as being modular components, so that there is a readable boundary in code between roles. There are some other examples of such elsewhere on the wiki. --Michael Mol 07:55, 24 August 2010 (UTC)

So let's simplify it to a direct string output. This omits the issue of File I/O, and the Python solution did that anyway. --Abu 09:46, 24 August 2010 (UTC)
String input? --Paddy3118 13:39, 24 August 2010 (UTC)
No, I meant indeed output, in the sense of "output a given string in Morse code". Anyway, the task itself says "Send a string ..." :) --Abu 13:51, 24 August 2010 (UTC)
Interesting. Now it simplifies to an encoding map. --Michael Mol 14:18, 24 August 2010 (UTC)


international morse code characters

The following are the international morse code characters:

. _                          A  letter
_ . . .                      B  letter
_ . _ .                      C  letter
_ . .                        D  letter
.                            E  letter
. . _ .                      F  letter
_ _ .                        G  letter
. . . .                      H  letter
. .                          I  letter
. _ _ _                      J  letter
_ . _                        K  letter
. _ . .                      L  letter
_ _                          M  letter
_ .                          N  letter
_ _ _                        O  letter
. _ _ .                      P  letter
_ _ . _                      Q  letter
. _ .                        R  letter
. . .                        S  letter
_                            T  letter
. . _                        U  letter
. . . _                      V  letter
. _ _                        W  letter
_ . . _                      X  letter
_ . _ _                      Y  letter
_ _ . .                      Z  letter
_ _ _ _ _                    0   digit
. _ _ _ _                    1   digit
. . _ _ _                    2   digit
. . . _ _                    3   digit
. . . . _                    4   digit
. . . . .                    5   digit
_ . . . .                    6   digit
_ _ . . .                    7   digit
_ _ _ . .                    8   digit
_ _ _ _ .                    9   digit
. _ _ _ _ .                  ' apostrophe
_ _ _ . . .                  : colon
_ _ . . _ _                  , comma
_ . . . . _                  - minus or hyphen
_ . _ _ . _                  ( left parenthesis
. _ . _ . _                  . period or dot
. . _ _ . .                  ? question mark
_ . _ . _ .                  ; semi-colon
_ . . _ .                    / slash or vergule or solidus
. . _ _ . _                  _ underscrore
. . . _ . . _                $ dollar sign
. _ . _ . .                  ! exclamation mark
_ _ _ . .                    ) right parenthesis
_ . . . _                    = equal sign
. _ _ . _ .                  @ comercial at
_ _ _ _ .                    & ampersand
. _ . . _ .                  " double-quote
. _ . _ .                    + plus sign

[added by Gerard Schildberger]

USA's railway morse code characters

The following are the USA's railway morse code characters, they're
the same as the international morse code except for the following:

. . _ .                      C, letter,          railroad
. long_ .                    F, letter,          railroad
_ . _ .                      J, letter,          railroad
long_                        L, letter,          railroad
. _ .                        O, letter,          railroad
. . . . .                    P, letter,          railroad
. . long_ .                  Q, letter,          railroad
. _ . .                      R, letter,          railroad
. long_ . .                  X, letter,          railroad
. . _ . .                    Y, letter,          railroad
. . . _ .                    Z, letter,          railroad
longer_                      0,  digit,          railroad
. _ _ .                      1,  digit,          railroad
. . long_ . .                2,  digit,          railroad
. . . long_ .                3,  digit,          railroad
_ _ _                        5,  digit,          railroad
. . . . . .                  6,  digit,          railroad
_ _ . .                      7,  digit,          railroad
_ . . . .                    8,  digit,          railroad
_ . . _                      9,  digit,          railroad
. _ . _                      , comma,            railroad
. . _ _ . .                  . period,           railroad
_ . . _ .                    ? question mark,    railroad
_ _ _ .                      ! exclamation mark, railroad
. _ . . .                    & ampersand,        railroad

[added by Gerard Schildberger]
Return to "Morse code" page.