home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume17 / morsecode / morse.p < prev   
Encoding:
Text File  |  1989-02-06  |  1.5 KB  |  69 lines

  1. (*
  2.     THIS PROGRAM IS COPYRIGHT 1989 NILS MCCARTHY
  3.     ALL RIGHTS RESERVED INCLUFING THAT OF MODIFYING
  4.     THIS PROGRAM WITHOUT THE AUTHOR'S CONSENT.
  5.     
  6.     THIS PROGRAM MAY BE FREELY DISTRIBUTABLE PROVIDED
  7.     THIS HEADER IS KEPT WITH IT.
  8.  
  9.     Please send any and all comments to mtymp01@ux.acss.umn.edu,
  10.     if user mtymp01 unknown, please send to mccarthy@ux.acss.umn.edu
  11.     with subject 'To Nils', because that isn't my account.
  12.  
  13. *)
  14. program genmorse(input,output);
  15. var
  16.     let : char;
  17. begin
  18.     repeat
  19.         read(let);
  20.         case let of
  21.             'a' : write('.- ');
  22.             'b' : write('-... ');
  23.             'c' : write('-.-. ');
  24.             'd' : write('-..');
  25.             'e' : write('. ');
  26.             'f' : write('..-.');
  27.             'g' : write('--.');
  28.             'h' : write('....');
  29.             'i' : write('..');
  30.             'j' : write('.---');
  31.             'k' : write('-.-');
  32.             'l' : write('.-..');
  33.             'm' : write('--');
  34.             'n' : write('-.');
  35.             'o' : write('---');
  36.             'p' : write('.--.');
  37.             'q' : write('--.-');
  38.             'r' : write('.-.');
  39.             's' : write('...');
  40.             't' : write('-');
  41.             'u' : write('.--');
  42.             'v' : write('...-');
  43.             'w' : write('.--');
  44.             'x' : write('-..-');
  45.             'y' : write('-.--');
  46.             'z' : write('--..');
  47.             '1' : write('.----');
  48.             '2' : write('..---');
  49.             '3' : write('...--');
  50.             '4' : write('....-');
  51.             '5' : write('.....');
  52.             '6' : write('-....');
  53.             '7' : write('--...');
  54.             '8' : write('---..');
  55.             '9' : write('----.');
  56.             '0' : write('-----');
  57.             '.' : write('.-.-.-');
  58.             ',' : write('--..--');
  59.             '?' : write('..--..');
  60.             ':' : write('---...');
  61.             ';' : write('-.-.-.');
  62.         else
  63.             write(chr(10));
  64.         end;
  65.         write(' ');
  66.     until EOF(input);
  67.     writeln('.-.-.')
  68. end.
  69.