Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
30
Task/Morse-code/Visual-Basic-.NET/morse-code.vb
Normal file
30
Task/Morse-code/Visual-Basic-.NET/morse-code.vb
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
Module Module1
|
||||
|
||||
Sub Main()
|
||||
Dim word = "sos"
|
||||
Dim codes As New Dictionary(Of String, String) From {
|
||||
{"a", ".- "}, {"b", "-... "}, {"c", "-.-. "}, {"d", "-.. "},
|
||||
{"e", ". "}, {"f", "..-. "}, {"g", "--. "}, {"h", ".... "},
|
||||
{"i", ".. "}, {"j", ".--- "}, {"k", "-.- "}, {"l", ".-.. "},
|
||||
{"m", "-- "}, {"n", "-. "}, {"o", "--- "}, {"p", ".--. "},
|
||||
{"q", "--.- "}, {"r", ".-. "}, {"s", "... "}, {"t", "- "},
|
||||
{"u", "..- "}, {"v", "...- "}, {"w", ".-- "}, {"x", "-..- "},
|
||||
{"y", "-.-- "}, {"z", "--.. "}, {"0", "-----"}, {"1", ".----"},
|
||||
{"2", "..---"}, {"3", "...--"}, {"4", "....-"}, {"5", "....."},
|
||||
{"6", "-...."}, {"7", "--..."}, {"8", "---.."}, {"9", "----."}
|
||||
}
|
||||
|
||||
For Each c In word.ToCharArray
|
||||
Dim rslt = codes(c).Trim
|
||||
For Each c2 In rslt.ToCharArray
|
||||
If c2 = "." Then
|
||||
Console.Beep(1000, 250)
|
||||
Else
|
||||
Console.Beep(1000, 750)
|
||||
End If
|
||||
System.Threading.Thread.Sleep(50)
|
||||
Next
|
||||
Next
|
||||
End Sub
|
||||
|
||||
End Module
|
||||
Loading…
Add table
Add a link
Reference in a new issue