|
DataMuseum.dkPresents historical artifacts from the history of: CP/M |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about CP/M Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - download
Length: 2048 (0x800) Types: TextFile Names: »MORSE1.PAS«
└─⟦08ea08c61⟧ Bits:30003924 PolyPascal programmer └─ ⟦this⟧ »MORSE1.PAS« └─⟦09235ab48⟧ Bits:30003065 Demoprogrammer K-Z til Pascal bog └─ ⟦this⟧ »MORSE1.PAS« └─⟦092727b26⟧ Bits:30005927 Demoprogrammer til Pascal bog (Jet-80) └─ ⟦this⟧ »MORSE1.PAS« └─⟦f983c2ef3⟧ Bits:30004681 Pascal opgaver (Butler) └─ ⟦this⟧ »MORSE1.PAS«
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»