Morse decode by D

procedure Gnat.Io.M is C:Character;procedure I(A:String:="_tmo______________gq______z_,____nky______c______dx______b______eawj______p______r_____._l______iu_______f______sv______h______")Is N,M,O:Integer:=(A'Length-1)/2;Begin
Get(C);M:=Character'Pos(c)-45;O:=A'First;if C in'-'..'.'Then
I(A(O+1+N*M..O+N+N*M));else Put(A(O-M/100));If C=' 'Then
Put(C);End If;End If;End;Begin
I;M;end;

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page