Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
27
Task/Morse-code/PascalABC.NET/morse-code.pas
Normal file
27
Task/Morse-code/PascalABC.NET/morse-code.pas
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
const
|
||||
Morse = dict(('A', '.-'), ('B', '-...'), ('C', '-.-.'), ('D', '-..'), ('E', string('.')),
|
||||
('F', '..-.'), ('G', '--.'), ('H', '....'), ('I', '..'), ('J', '.---'),
|
||||
('K', '-.-'), ('L', '.-..'), ('M', '--'), ('N', '-.'), ('O', '---'),
|
||||
('P', '.--.'), ('Q', '--.-'), ('R', '.-.'), ('S', '...'), ('T', string('-')),
|
||||
('U', '..-'), ('V', '...-'), ('W', '.--'), ('X', '-..-'), ('Y', '-.--'),
|
||||
('Z', '--..'), ('0', '-----'), ('1', '.----'), ('2', '..---'), ('3', '...--'),
|
||||
('4', '....-'), ('5', '.....'), ('6', '-....'), ('7', '--...'), ('8', '---..'),
|
||||
('9', '----.'), ('.', '.-.-.-'), (',', '--..--'), ('?', '..--..'), ('\', '.----.'),
|
||||
('!', '-.-.--'), ('/', '-..-.'), ('(', '-.--.'), (')', '-.--.-'), ('&', '.-...'),
|
||||
(':', '---...'), (';', '-.-.-.'), ('=', '-...-'), ('+', '.-.-.'), ('-', '-....-'),
|
||||
('_', '..--.-'), ('''', '.-..-.'), ('$', '...-..-'), ('@', '.--.-.'));
|
||||
|
||||
procedure SayMorse(s: string);
|
||||
begin
|
||||
foreach var c in s do
|
||||
begin
|
||||
foreach var c2 in Morse.get(c.ToUpper, '') do
|
||||
if c2 = '.' then console.Beep(1000, 250)
|
||||
else console.Beep(1000, 750);
|
||||
sleep(1000);
|
||||
end;
|
||||
end;
|
||||
|
||||
begin
|
||||
SayMorse('SOS');
|
||||
end.
|
||||
Loading…
Add table
Add a link
Reference in a new issue