Morse Code Generation |
In determining the speed of transmission of messages in Morse code, the controlling element is the dot, `.'. The dash, `-', is three dots in length. Within a character the space between sounds is considered to be a dot in length. The inter-character space is at least a dash in length and the interword space is three dashes in length. It is assumed that each word is five characters in length.
For transmission speeds below thirteen (13) words-per-minute, the
individual characters are formed using the dot length of thirteen words per
minute, with the extra time placed between each character. Thus at 6.5
words per minute, the inter character space is twice that of a 13 wpm
transmission.
Above 13 wpm, both the character time and the inter character spacing are
controlled by the speed.
For the purpose of this problem assume that the average character is eight
(8) dots in length. Thus for a standard of 13 wpm transmission there would
be 65+13=78 characters per minute or 78*8=624 dot spaces per minute. You are
to use this value for the basis of your program.
A file consisting of:
A copy of the message to be sent, one character (an upper case letter or a number) per line followed by a listing, as integers of the number of milliseconds the transmitter will be on and the number of milliseconds the transmitter will be off to result in the desired speed. Each time is to be preceeded and followed by a white space. Sound times will be followed by a single character `S' and no sound times will be followed by a single character `N'. The required inter character spacing will be the last entry in a line. Each line will be terminated by a new line character.
A blank line separates the output of two messages
Complete set of characters:
Below is a table of the characters which can be used for testing and
their Morse Code representation.
A .- J .--- S ... 1 .---- B -... K -.- T - 2 ..--- C -.-. L .-.. U ..- 3 ...-- D -.. M -- V ...- 4 ....- E . N -. W .-- 5 ..... F ..-. O --- X -..- 6 -.... G --. P .--. Y -.-- 7 --... H .... Q --.- Z --.. 8 ---.. I .. R .-. 0 ----- 9 ----.
A .- B -... D -.. G --. O --- Y -.-- @ 5 A BAD BOY @ 13 A good boy
A 115 S 115 N 345 S 115 N 1428 N 4284 N B 345 S 115 N 115 S 115 N 115 S 115 N 115 S 115 N 1428 N A 115 S 115 N 345 S 115 N 1428 N D 345 S 115 N 115 S 115 N 115 S 115 N 1428 N 4284 N B 345 S 115 N 115 S 115 N 115 S 115 N 115 S 115 N 1428 N O 345 S 115 N 345 S 115 N 345 S 115 N 1428 N Y 345 S 115 N 115 S 115 N 345 S 115 N 345 S 115 N 1428 N A 115 S 115 N 345 S 115 N 345 N 1035 N G 345 S 115 N 345 S 115 N 115 S 115 N 345 N O 345 S 115 N 345 S 115 N 345 S 115 N 345 N O 345 S 115 N 345 S 115 N 345 S 115 N 345 N D 345 S 115 N 115 S 115 N 115 S 115 N 345 N 1035 N B 345 S 115 N 115 S 115 N 115 S 115 N 115 S 115 N 345 N O 345 S 115 N 345 S 115 N 345 S 115 N 345 N Y 345 S 115 N 115 S 115 N 345 S 115 N 345 S 115 N 345 N