June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
55
Task/Morse-code/Ring/morse-code.ring
Normal file
55
Task/Morse-code/Ring/morse-code.ring
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
morsecode = [["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", "----."]]
|
||||
strmorse = ""
|
||||
str = "this is a test text"
|
||||
for n = 1 to len(str)
|
||||
pos = 0
|
||||
for m = 1 to len(morsecode)
|
||||
if morsecode[m][1] = str[n]
|
||||
pos = m
|
||||
ok
|
||||
next
|
||||
if str[n] = " "
|
||||
strmorse = strmorse + " "
|
||||
else
|
||||
if pos > 0
|
||||
strmorse = strmorse + morsecode[pos][2] + "|"
|
||||
ok
|
||||
ok
|
||||
next
|
||||
strmorse = left(strmorse,len(strmorse)-1)
|
||||
see strmorse + nl
|
||||
Loading…
Add table
Add a link
Reference in a new issue