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

29 lines
664 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
txt$ = "sos sos"
#
2024-04-19 16:56:29 -07:00
chars$ = "abcdefghijklmnopqrstuvwxyz "
2023-07-01 11:58:00 -04:00
code$[] = [ ".-" "-..." "-.-." "-.." "." "..-." "--." "...." ".." ".---" "-.-" ".-.." "--" "-." "---" ".--." "--.-" ".-." "..." "-" "..-" "...-" ".--" "-..-" "-.--" "--.." " " ]
#
proc morse ch$ . .
2024-04-19 16:56:29 -07:00
ind = strpos chars$ ch$
if ind > 0
2023-07-01 11:58:00 -04:00
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$
2023-09-16 17:28:03 -07:00
morse ch$
2023-07-01 11:58:00 -04:00
.