DataMuseum.dk

Presents historical artifacts from the history of:

Bogika Butler

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Bogika Butler

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - download

⟦ed999e63b⟧ TextFile

    Length: 2048 (0x800)
    Types: TextFile
    Names: »MORSE1.PAS«

Derivation

└─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler)
    └─ ⟦this⟧ »MORSE1.PAS« 

TextFile

PROGRAM morse1;

  TYPE
    str127 = STRING(.127.);
    str5 = STRING(.5.);
  
  VAR
    tekst : str127;
    morse : str5;
    ch : CHAR;
    i, position : INTEGER;
  
  BEGIN
    WRITE(CLRHOM);
    WRITELN('Indtast teksten (kun små bogstaver og mellemrum):');
    READLN(tekst);
    WRITELN;
    WRITELN('Morseteksten (ulovlige tegn skrives som ''*''):');
    position := 0;
    FOR i := 1 TO LEN(tekst) DO
      BEGIN
        ch := tekst(.i.);
        CASE ch OF
          ' ' : morse := '  ';
          'a' : morse := '.-';
          'b' : morse := '-...';
          'c' : morse := '-.-.';
          'd' : morse := '-..';
          'e' : morse := '.';
          'f' : morse := '..-.';
          'g' : morse := '--.';
          'h' : morse := '....';
          'i' : morse := '..';
          'j' : morse := '.---';
          'k' : morse := '-.-';
          'l' : morse := '.-..';
          'm' : morse := '--';
          'n' : morse := '-.';
          'o' : morse := '---';
          'p' : morse := '.--.';
          'q' : morse := '--.-';
          'r' : morse := '.-.';
          's' : morse := '...';
          't' : morse := '-';
          'u' : morse := '..-';
          'v' : morse := '...-';
          'w' : morse := '.--';
          'x' : morse := '-..-';
          'y' : morse := '-.--';
          'z' : morse := '--..';
          'æ' : morse := '.-.-';
          'ø' : morse := '---.';
          'å' : morse := '.--.-';
        OTHERWISE
          morse := '*';
        END;
        IF morse = '  '
          THEN 
            BEGIN
              WRITE('/ ');
              position := position + 2;
            END
          ELSE 
            BEGIN
              WRITE(morse, '  ');
              position := position + LEN(morse) + 2;
            END;
        IF position > 73
          THEN
            BEGIN
              WRITELN;
              position := 0;
            END;
      END;
    WRITELN;
  END.
«eof»