RosettaCodeData/Task/Morse-code/EasyLang/morse-code.easy

29 lines
664 B
Plaintext

txt$ = "sos sos"
#
chars$ = "abcdefghijklmnopqrstuvwxyz "
code$[] = [ ".-" "-..." "-.-." "-.." "." "..-." "--." "...." ".." ".---" "-.-" ".-.." "--" "-." "---" ".--." "--.-" ".-." "..." "-" "..-" "...-" ".--" "-..-" "-.--" "--.." " " ]
#
proc morse ch$ . .
ind = strpos chars$ ch$
if ind > 0
write ch$ & " "
sleep 0.4
for c$ in strchars code$[ind]
write c$
if c$ = "."
sound [ 440 0.2 ]
sleep 0.4
elif c$ = "-"
sound [ 440 0.6 ]
sleep 0.8
elif c$ = " "
sleep 0.8
.
.
print ""
.
.
for ch$ in strchars txt$
morse ch$
.